/* ===================== MAIN LAYOUT ===================== */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem; /* فاصله استاندارد تا در موبایل به لبه‌ها نچسبد */
}

.spinner-dark {
    border: 2px solid rgba(30,111,92,0.2);
    border-top-color: #1e6f5c;
}


/* کارت اصلی - هم‌خانواده با .plan-card */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 36px;
    padding: 40px 32px 32px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);
    border: 1px solid rgba(30,111,92,0.15);
}

/* ===================== STEP TRANSITIONS ===================== */
.auth-step {
    display: none;
    animation: fadeIn 0.35s ease;
}
.auth-step.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================== ICON ===================== */
.auth-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #e5f4ee, #d5ebe2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #1e6f5c;
    margin: 0 auto 20px;
    box-shadow: 0 8px 18px -8px rgba(30,111,92,0.35);
}

/* ===================== HEADINGS ===================== */
.auth-card h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f2b3d;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: #4a6f7c;
    font-size: 0.92rem;
    margin-bottom: 26px;
    line-height: 1.7;
}

/* ===================== FORM ===================== */
.form-group { margin-bottom: 18px; }

.input-wrapper { position: relative; }

.input-wrapper input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 28px;
    border: 1.5px solid #cbdde0;
    font-family: inherit;
    font-size: 1.05rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    letter-spacing: 1.5px;
    color: #0f2b3d;
}

.input-wrapper input::placeholder {
    color: #a2bcc4;
    letter-spacing: 1px;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #1e6f5c;
    box-shadow: 0 0 0 4px rgba(30,111,92,0.1);
}

.input-wrapper input.has-error {
    border-color: #d9534f;
    box-shadow: 0 0 0 4px rgba(217,83,79,0.1);
}

.error-msg {
    display: none;
    color: #d9534f;
    font-size: 0.83rem;
    margin-top: 8px;
    text-align: center;
    font-weight: 500;
}
.error-msg.visible { display: block; }

/* ===================== PRIMARY BUTTON ===================== */
.btn-primary {
    display: block;
    width: 100%;
    padding: 14px 28px;
    border-radius: 40px;
    background: #1e6f5c;
    color: white;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 8px;
    box-shadow: 0 6px 16px -6px rgba(30,111,92,0.4);
}

.btn-primary:hover:not(:disabled) {
    background: #0e5444;
    box-shadow: 0 8px 20px -6px rgba(30,111,92,0.5);
}

.btn-primary:active:not(:disabled) { transform: scale(0.98); }

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== OTP INPUTS ===================== */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    direction: ltr;
    margin: 4px 0 8px;
}

.otp-inputs input {
    width: 54px;
    height: 62px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1.5px solid #cbdde0;
    background: white;
    font-family: inherit;
    transition: all 0.2s;
    color: #0f2b3d;
    caret-color: #1e6f5c;
}

.otp-inputs input:focus {
    outline: none;
    border-color: #1e6f5c;
    box-shadow: 0 0 0 4px rgba(30,111,92,0.1);
    transform: translateY(-2px);
}

.otp-inputs input.filled {
    border-color: #1e6f5c;
    background: #f3f9f6;
}

/* ===================== PHONE BADGE ===================== */
.phone-badge-wrap {
    text-align: center;
    margin-bottom: 22px;
}

.phone-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f9f6;
    border: 1px solid #c9e1d9;
    border-radius: 30px;
    padding: 8px 18px;
    color: #1f4e43;
    font-weight: 600;
    font-size: 0.95rem;
}

.phone-badge i {
    color: #1e6f5c;
    font-size: 0.9rem;
}

.phone-badge .phone-num {
    direction: ltr;
    letter-spacing: 0.5px;
}

/* ===================== AUTH ACTIONS ===================== */
.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: #1e6f5c;
    font-family: inherit;
    font-size: 0.87rem;
    cursor: pointer;
    padding: 6px 10px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    border-radius: 8px;
}

.btn-link:hover:not(:disabled) {
    color: #0e5444;
    background: rgba(30,111,92,0.06);
}

.btn-link:disabled {
    color: #a0b8bc;
    cursor: not-allowed;
}

/* ===================== TERMS ===================== */
.terms-text {
    text-align: center;
    font-size: 0.78rem;
    color: #7a96a0;
    margin-top: 20px;
    line-height: 1.7;
}

.terms-text a {
    color: #1e6f5c;
    text-decoration: none;
    font-weight: 600;
}

.terms-text a:hover { text-decoration: underline; }

/* دکمه تغییر شماره در بالای کارت */
.change-phone-top {
    font-size: 0.85rem !important;
    color: #4a6f7c !important;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.change-phone-top:hover {
    color: #1e6f5c !important;
}

.change-phone-top i {
    font-size: 0.75rem;
}

/* ===================== SUCCESS STATE ===================== */
.success-icon {
    width: 84px;
    height: 84px;
    background: linear-gradient(135deg, #e5f4ee, #d0ebdf);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: #1e6f5c;
    margin: 0 auto 22px;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 22px -10px rgba(30,111,92,0.4);
}

@keyframes popIn {
    0%   { transform: scale(0.3); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 780px) {
    main { padding: 30px 16px; }
    .auth-card {
        padding: 32px 22px 26px;
        border-radius: 28px;
    }
    .auth-card h2 { font-size: 1.3rem; }
    .otp-inputs { gap: 7px; }
    .otp-inputs input {
        width: 46px;
        height: 54px;
        font-size: 1.3rem;
        border-radius: 16px;
    }
}