/* ============================================================
   EduMaster — Auth / Login Page Styles
   Premium, clean, minimal login experience
   ============================================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF0F7 0%, #E0E5F0 50%, #D8DEF0 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Subtle decorative circles */
.auth-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(67, 83, 255, 0.06) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
    animation: authCardIn 0.5s ease;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authCardEntrance {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: contain;
    margin-bottom: 14px;
}

.auth-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #9CA3AF);
    font-weight: 400;
}

.auth-error {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 16px;
    display: none;
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-error.visible { display: block; }

.auth-error.success {
    background: rgba(34, 197, 94, 0.08);
    color: #22C55E;
    border-color: rgba(34, 197, 94, 0.15);
}

.auth-btn {
    width: 100%;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    background: var(--primary, #4353FF);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(67, 83, 255, 0.25);
}

.auth-btn:hover {
    background: var(--primary-dark, #3040E0);
    box-shadow: 0 6px 20px rgba(67, 83, 255, 0.3);
    transform: translateY(-1px);
}

.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.auth-btn:disabled:hover {
    background: var(--primary, #4353FF);
    box-shadow: none;
    transform: none;
}

.auth-link {
    color: var(--primary, #4353FF);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--text-muted, #9CA3AF);
    font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass, #E5E7EB);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-glass, #E5E7EB);
    border-radius: 10px;
    background: white;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary, #111827);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: var(--bg-input, #F4F6FB);
    border-color: var(--text-muted, #9CA3AF);
}

.btn-google:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-google:disabled:hover {
    background: white;
    border-color: var(--border-glass, #E5E7EB);
}

.btn-google svg { flex-shrink: 0; }

.btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid #000;
    border-radius: 10px;
    background: #000;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apple:hover {
    background: #1a1a1a;
}

.btn-apple:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-apple:disabled:hover {
    background: #000;
}

.btn-apple svg { flex-shrink: 0; }

/* The sitewide input:focus-visible rule (styles.css) puts a 3px outline +
   2px offset on every input, sized for text fields. On these 15px
   checkboxes — especially iOS's native rounded control geometry — that
   balloons into an oversized pill-shaped ring. Give checkboxes their own
   tight, correctly-sized ring instead. */
.auth-card input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--primary, #4353FF);
    outline-offset: 1px;
    border-radius: 3px;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light, #F3F4F6);
}

.auth-branding {
    font-size: 0.72rem;
    color: var(--text-muted, #9CA3AF);
}

.powered-by { margin-right: 3px; }

.brand-name {
    font-weight: 600;
    color: var(--text-secondary, #6B7280);
}

.privacy-link {
    font-size: 0.72rem;
    color: var(--text-muted, #9CA3AF);
    text-decoration: none;
}

.privacy-link:hover { color: var(--primary, #4353FF); text-decoration: underline; }

/* Mobile/auth touch targets that live outside the normal ERP page container. */
.auth-container .auth-link,
.auth-container .privacy-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    touch-action: manipulation;
}

#account-modal button[onclick*="account-modal"] {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
}

#account-modal summary {
    min-height: 44px !important;
    padding: 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    touch-action: manipulation;
}

@media (max-width: 480px) {
    #account-modal {
        align-items: flex-end !important;
    }

    #account-modal > div {
        max-height: calc(100dvh - 18px - env(safe-area-inset-top, 0px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 10px !important;
        padding: 28px 24px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 26px 26px 0 0 !important;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 24px;
        border-radius: 20px;
    }
    .auth-title { font-size: 1.3rem; }
    .auth-logo { width: 48px; height: 48px; }
}
