/* =====================================================
   Auth Styles (Login & Register) - PremiumShop
   (Clean White Background Design)
===================================================== */

body {
    background-color: #ffffff;
}

.auth-page {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: #ffffff;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    margin-top: 60px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.auth-card.auth-card-wide {
    max-width: 600px;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2168ff, #60a5fa);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #2168ff;
    text-decoration: none;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}



.otp-code-input {
    text-align: center;
    font-size: 1.5rem !important;
    letter-spacing: 8px;
    font-weight: 800;
    color: #2168ff;
}

.timer-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.resend-link {
    color: #2168ff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.resend-link.disabled {
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.phone-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

.phone-badge-number {
    font-weight: 700;
    color: #0f172a;
    direction: ltr;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 580px) {
    .auth-grid-2 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.form-label {
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 14px;
    color: #0f172a;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2168ff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(33, 104, 255, 0.15);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-help {
    color: #64748b;
    font-size: 0.78rem;
    margin-top: 4px;
}

.field-error {
    color: #ef4444;
    font-size: 0.82rem;
    margin-top: 4px;
    display: block;
}

.form-errors-alert {
    background: #fef2f2;
    border: 1px solid #fecdd3;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.form-errors-alert ul {
    margin: 4px 0 0 0;
    padding-right: 20px;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #2168ff;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-submit-btn {
    width: 100%;
    background: #2168ff;
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(33, 104, 255, 0.25);
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: #1455e6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 104, 255, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #2168ff;
    text-decoration: none;
    font-weight: 600;
    margin-right: 6px;
    transition: color 0.2s;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   UNIFIED SINGLE-PAGE AUTH COMPONENTS
===================================================== */

/* Phone input with Iran flag prefix */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix .form-input {
    padding-left: 58px;
    direction: ltr;
    text-align: left;
    font-size: 1.05rem;
    letter-spacing: 1px;
}

.phone-prefix-flag {
    position: absolute;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    direction: ltr;
    pointer-events: none;
    user-select: none;
}

/* Welcome box in step 3 */
.register-welcome-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.25rem;
    color: #166534;
    font-size: 0.88rem;
    line-height: 1.5;
}

.welcome-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.register-welcome-box strong {
    display: block;
    font-size: 0.95rem;
    color: #15803d;
    margin-bottom: 2px;
}

.register-welcome-box p {
    margin: 0;
    color: #166534;
}

/* Switch mode links */
.auth-switch-mode {
    text-align: center;
    margin-top: 1rem;
}

.link-btn {
    background: none;
    border: none;
    color: #2168ff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.link-btn:hover {
    background-color: #f0f5ff;
    text-decoration: underline;
}

/* Password wrapper with visibility toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    padding-left: 42px;
}

.toggle-password-btn {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: #2168ff;
}

/* Form Animation */
.step-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}