/**
 * Auth pages (login / register) — Bold Sketch Outline / Hand-drawn Cartoon Line Theme
 * Flat colors (Logo Electric Blue + Black + Gold), thick 3px outlines, hard line shadows
 */

body.auth-page {
    font-family: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;
    background: #f0f9ff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
    color: #0f172a;
}

body.auth-page::before,
body.auth-page::after {
    display: none;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: #ffffff;
    border-radius: 22px 18px 24px 20px;
    box-shadow: 7px 7px 0px #0f172a;
    border: 3.5px solid #0f172a;
    padding: 2.2rem;
    width: 100%;
}

.auth-logo {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
    margin: 0 auto 0.85rem;
    display: block;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0284c7;
}

.auth-tabs {
    display: flex;
    background: #e0f2fe;
    border-radius: 16px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    border: 2.8px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    gap: 0.3rem;
}

.auth-tab {
    flex: 1;
    padding: 0.7rem 0.75rem;
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0369a1;
    border-radius: 12px;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab:hover {
    color: #0f172a;
}

.auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    border: 2.5px solid #0f172a;
    box-shadow: 2.5px 2.5px 0px #0f172a;
}

.auth-tab.active.student {
    color: #0284c7;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-icon {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    color: #0f172a;
    font-size: 1rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 2.6rem 0.75rem 0.9rem;
    border: 2.8px solid #0f172a;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 700;
    box-shadow: 3px 3px 0px rgba(15, 23, 42, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    font-family: inherit;
}

.auth-input-wrap .auth-input {
    padding-left: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    border: 2px solid var(--line, #0f172a);
    border-radius: 10px;
    background: #e0f2fe;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: #0f172a;
    background: #f59e0b;
}

.auth-password-meter {
    height: 0.45rem;
    background: #e2e8f0;
    border: 2px solid #0f172a;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.6rem;
}

.auth-password-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 3.5px 3.5px 0px #0284c7;
}

.auth-input.secure-code {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.2em;
    font-size: 1.25rem;
    padding-right: 0.85rem;
    text-transform: uppercase;
    font-weight: 900;
}

.auth-hint {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 700;
}

.auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3.1rem;
    padding: 0.75rem 1rem;
    border: 3px solid #0f172a;
    border-radius: 16px;
    font-weight: 900;
    font-size: 1rem;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 4px 4px 0px #0f172a;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
    font-family: inherit;
}

.auth-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #0f172a;
}

.auth-btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #0f172a;
}

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

.auth-btn-primary {
    background: #0284c7;
    color: #ffffff;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #0369a1;
}

.auth-btn-success {
    background: #f59e0b;
    color: #0f172a;
}

.auth-btn-success:hover:not(:disabled) {
    background: #d97706;
    color: #ffffff;
}

.auth-btn-dark {
    background: #0369a1;
    color: #ffffff;
}

.auth-btn-dark:hover:not(:disabled) {
    background: #0c4a6e;
}

.auth-alert {
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 1.1rem;
    display: none;
    line-height: 1.6;
    white-space: pre-line;
    border: 2.5px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
}

.auth-alert.show {
    display: block;
}

.auth-alert-error {
    background: #fecaca;
    color: #991b1b;
}

.auth-alert-success {
    background: #bae6fd;
    color: #0369a1;
}

.auth-alert-info {
    background: #e0f2fe;
    color: #0369a1;
}

.auth-link {
    color: #0284c7;
    font-weight: 800;
    text-decoration: none;
}

.auth-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.auth-footer-link {
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-link:hover {
    color: #0f172a;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.auth-check input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #0284c7;
    border: 2px solid #0f172a;
}

.auth-check label {
    font-size: 0.88rem;
    color: #0f172a;
    font-weight: 700;
}

.auth-info-box {
    background: #e0f2fe;
    border: 2.5px solid #0f172a;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    box-shadow: 3px 3px 0px #0f172a;
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 640px) {
    .auth-shell {
        align-items: flex-start;
        padding-top: 1.25rem;
    }

    .auth-card {
        padding: 1.4rem;
        border-radius: 18px;
    }

    .auth-logo {
        width: 4.5rem;
        height: 4.5rem;
    }
}

.auth-info-box .icon {
    color: #0f172a;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2.5px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-color-scheme: dark) {
    body.auth-page {
        background: #f0f9ff;
        color: #0f172a;
    }
}
