/*
 * JetOTP Common Styles
 * Shared across login, register, forgot password
 */

/* ===== Container ===== */
.jetotp-container {
    padding: 0;
    margin: 0;
    font-family: inherit;
}

/* ===== Form Elements ===== */
.jetotp-form-group {
    margin-bottom: 20px;
}

.jetotp-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: #111;
    background: transparent !important;
    border: 1px solid #d5d8dc !important;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
    height: 46px;
}

.jetotp-input::placeholder {
    color: #9aa0a6;
    font-size: 16px;
}

.jetotp-input:hover {
    background: #fff !important;
    border: 1px solid #828b97 !important;
}

.jetotp-input:focus {
    box-shadow: none !important;
}

/* ===== OTP Input Group ===== */
.jetotp-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    direction: ltr;
    margin: 0 0 20px 0;
}

.jetotp-otp-input {
    width: 45px;
    height: 52px;
    text-align: center !important;
    font-size: 20px;
    font-weight: 500;
    font-family: monospace, Tahoma;
    color: #111;
    background: transparent !important;
    border: 1px solid #d5d8dc !important;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    overflow: hidden;
    -webkit-text-security: none;
}

.jetotp-otp-input:hover {
    background: #fff !important;
    border: 1px solid #828b97 !important;
}

.jetotp-otp-input:focus {
    box-shadow: none !important;
}

/* ===== Button ===== */
.jetotp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 400 !important;
    font-family: inherit;
    color: #45f2b6 !important;
    background: #040080 !important;
    border: none !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.jetotp-btn:hover {
    background: #0500a3 !important;
}

.jetotp-btn:active {
    opacity: 1;
}

.jetotp-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.jetotp-btn.loading {
    opacity: 1;
    cursor: not-allowed;
}

/* ===== Spinner ===== */
.jetotp-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: jetotp-spin 0.7s linear infinite;
}

.loading .jetotp-spinner {
    display: inline-block;
}

.loading .jetotp-btn-text {
    display: none;
}

@keyframes jetotp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Toast Notification ===== */
.jetotp-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    z-index: 999999;
    min-width: 300px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    font-family: inherit;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #ffffff;
    pointer-events: none;
}

.jetotp-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* آیکون کنار پیام */
.jetotp-toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-top: 1px;
}

/* بدنه متنی */
.jetotp-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jetotp-toast-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.jetotp-toast-desc {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.85;
}

/* حالت موفقیت */
.jetotp-toast.success {
    background: #f0fdf8;
    border: 1px solid rgba(0, 184, 148, 0.25);
}

.jetotp-toast.success .jetotp-toast-icon {
    background: #00b894;
    color: #fff;
}

.jetotp-toast.success .jetotp-toast-title {
    color: #00796b;
}

.jetotp-toast.success .jetotp-toast-desc {
    color: #00796b;
}

/* حالت خطا */
.jetotp-toast.error {
    background: #fff5f4;
    border: 1px solid rgba(225, 112, 85, 0.25);
}

.jetotp-toast.error .jetotp-toast-icon {
    background: #e17055;
    color: #fff;
}

.jetotp-toast.error .jetotp-toast-title {
    color: #c0392b;
}

.jetotp-toast.error .jetotp-toast-desc {
    color: #c0392b;
}

/* حالت اطلاع‌رسانی */
.jetotp-toast.info {
    background: #f0f4ff;
    border: 1px solid rgba(74, 100, 255, 0.2);
}

.jetotp-toast.info .jetotp-toast-icon {
    background: #4a64ff;
    color: #fff;
}

.jetotp-toast.info .jetotp-toast-title {
    color: #2d3fcc;
}

.jetotp-toast.info .jetotp-toast-desc {
    color: #2d3fcc;
}

/* ===== Steps ===== */
.jetotp-step {
    display: none;
}

.jetotp-step.active {
    display: block;
}

/* ===== Sent Info & Edit ===== */
.jetotp-sent-info {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jetotp-sent-info p {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
}

.jetotp-sent-info strong {
    color: #111;
    font-weight: 500;
}

.jetotp-back,
.jetotp-reg-back,
.jetotp-forgot-back,.jetotp-update-phone-back {
    background: transparent;
    border: none;
    color: #92003b !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: all 0.2s ease;
}

.jetotp-back:hover,
.jetotp-reg-back:hover,
.jetotp-forgot-back:hover,.jetotp-update-phone-back:hover {
    background: transparent;
    text-decoration: none;
    opacity: 0.8;
}

/* ===== Timer & Resend ===== */
.jetotp-timer-count,
.jetotp-reg-timer-count,
.jetotp-forgot-timer-count,
.jetotp-update-phone-timer-count {
    font-weight: 600;
    color: #111;
    margin-left: 4px;
}

.jetotp-resend-btn,
.jetotp-reg-resend-btn,
.jetotp-forgot-resend-btn {
    background: transparent;
    border: none;
    color: #92003b !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: all 0.2s ease;
}

.jetotp-resend-btn:hover,
.jetotp-reg-resend-btn:hover,
.jetotp-forgot-resend-btn:hover {
    background: transparent;
    text-decoration: none;
    opacity: 0.8;
}

/* ===== Logged In ===== */
.jetotp-logged-in {
    text-align: center;
    padding: 20px 0;
}

.jetotp-btn-outline {
    display: inline-block;
    padding: 10px 20px;
    color: #111;
    background: transparent;
    border: 1px solid #aeb2b8;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jetotp-btn-outline:hover {
    border-color: #111;
}

/* ===== Inline Style Replacements ===== */

/* Buttons - margin-top spacing */
.jetotp-btn.minimalist-btn {
    margin-top: 20px;
}

/* Message area - hidden by default with top margin */
.jetotp-message {
    display: none;
    margin-top: 15px;
}

/* Password group - hidden by default */
.jetotp-password-group {
    display: none;
    margin-top: 15px;
}

/* Email OTP switch button */
#jetotp-btn-email-otp {
    color: #666;
    font-size: 13px;
}

/* Password group action alignment */
.jetotp-password-actions {
    text-align: right;
    margin-top: 10px;
}

/* Timer wrap - hidden by default, RTL direction */
.jetotp-timer-wrap,
.jetotp-reg-timer-wrap,
.jetotp-update-phone-timer-wrap {
    display: none;
    direction: rtl;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #5f6368;
}

/* Resend buttons - hidden by default */
.jetotp-resend,
.jetotp-reg-resend,
.jetotp-forgot-resend,
.jetotp-update-phone-resend {
    display: none;
    margin-top: 16px;
    text-align: center;
}

/* Register form - form group spacing */
.jetotp-register-container .jetotp-form-group {
    margin-bottom: 15px;
}

/* Forgot password form - new password field spacing */
.jetotp-forgot-step-2 .jetotp-form-group+.jetotp-form-group {
    margin-top: 15px;
}

/* ===== Success Messages ===== */

/* Register success */
.jetotp-reg-success {
    text-align: center;
    padding: 20px 0;
}

.jetotp-reg-success-title {
    font-size: 16px;
    color: #2ecc71;
    margin-bottom: 15px;
}

.jetotp-reg-success-subtitle {
    color: #666;
}

/* Forgot password success */
.jetotp-success-message {
    text-align: center;
    padding: 30px 0;
}

.jetotp-success-icon {
    display: block;
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 15px;
}

.jetotp-success-text {
    font-size: 16px;
    color: #333;
}

/* ===== Update Phone ===== */

.jetotp-update-phone-resend-btn {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.jetotp-update-phone-resend-btn:hover {
    text-decoration: underline;
}