/* ══════════════════════════════════════════════════════════════
   Auth Pages — Login, Register, Magic Link
   ══════════════════════════════════════════════════════════════ */

/* ── Background ── */
.content {
    background: #f0f2f5;
    min-height: 100vh;
}

[data-bs-theme="dark"] .content {
    background: #0c0e14;
}

/* ── Wrapper ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    flex-direction: column;
}

/* ── Container (Card) ── */
.auth-container {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

[data-bs-theme="dark"] .auth-container {
    background: #171a25;
    box-shadow: none;
}

/* ── Logo ── */
.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    width: auto;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
}

/* Light/Dark Logo Toggle */
.auth-logo img.auth-logo-dark {
    display: none !important;
}

[data-bs-theme="dark"] .auth-logo img.auth-logo-light {
    display: none !important;
}

[data-bs-theme="dark"] .auth-logo img.auth-logo-dark {
    display: inline !important;
}

/* ── Header ── */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

[data-bs-theme="dark"] .auth-title {
    color: #f3f4f6;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

[data-bs-theme="dark"] .auth-subtitle {
    color: #9ca3af;
}

/* ── Alerts ── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

[data-bs-theme="dark"] .auth-alert-danger {
    background: rgba(220, 38, 38, 0.08);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.15);
}

.auth-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

[data-bs-theme="dark"] .auth-alert-success {
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.15);
}

/* ── Form ── */
.auth-form {
    width: 100%;
}

/* ── Input Groups ── */
.auth-input-group {
    margin-bottom: 0.75rem;
}

.auth-label {
    display: none;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    display: block;
    position: absolute;
    left: 14px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

[data-bs-theme="dark"] .auth-input-icon {
    color: #525b75;
}

.auth-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    font-size: 15px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: #1f2937;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input:focus {
    border-color: rgba(0, 188, 13, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 188, 13, 0.08);
    background: #fff;
}

[data-bs-theme="dark"] .auth-input {
    background: #0f1119;
    border-color: #2d3348;
    color: #d1d5db;
}

[data-bs-theme="dark"] .auth-input::placeholder {
    color: #4b5563;
}

[data-bs-theme="dark"] .auth-input:focus {
    border-color: rgba(0, 188, 13, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 188, 13, 0.1);
    background: #141824;
}

/* ── Password Toggle ── */
.auth-input-password {
    padding-right: 48px;
}

.auth-toggle-password {
    position: absolute;
    right: 10px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.auth-toggle-password:hover {
    color: #00bc0d;
}

[data-bs-theme="dark"] .auth-toggle-password {
    color: #525b75;
}

[data-bs-theme="dark"] .auth-toggle-password:hover {
    color: #00bc0d;
}

/* ── Data Protection Notice (kept for magic link) ── */
.auth-notice {
    margin-bottom: 1.25rem;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 10px;
}

.auth-notice p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
}

[data-bs-theme="dark"] .auth-notice {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .auth-notice p {
    color: #9ca3af;
}

/* ── Privacy Checkbox ── */
.auth-privacy {
    margin-bottom: 1.25rem;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s;
}

.auth-privacy:has(input:checked) {
    border-color: rgba(0, 188, 13, 0.3);
    background: rgba(0, 188, 13, 0.03);
}

.auth-privacy:has(input:checked) .auth-link-primary {
    color: #00a00a;
}

.auth-privacy .auth-checkbox {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.auth-privacy .auth-checkbox span {
    flex: 1;
}

[data-bs-theme="dark"] .auth-privacy {
    background: #0f1119;
    border-color: #2d3348;
}

[data-bs-theme="dark"] .auth-privacy:has(input:checked) {
    border-color: rgba(0, 188, 13, 0.3);
    background: rgba(0, 188, 13, 0.04);
}

[data-bs-theme="dark"] .auth-privacy:has(input:checked) .auth-link-primary {
    color: #4ade80;
}

/* ── Data Protection Page ── */
.data-protection-content {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.data-protection-content h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.data-protection-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.data-protection-content p {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.data-protection-content ul {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.7;
    padding-left: 20px;
}

.data-protection-content a {
    color: #00bc0d;
    text-decoration: none;
}

.data-protection-content a:hover {
    text-decoration: underline;
}

[data-bs-theme="dark"] .data-protection-content h1,
[data-bs-theme="dark"] .data-protection-content h3 {
    color: #f3f4f6;
}

[data-bs-theme="dark"] .data-protection-content p,
[data-bs-theme="dark"] .data-protection-content ul {
    color: #9ca3af;
}

[data-bs-theme="dark"] .data-protection-content a {
    color: #4ade80;
}

/* ── Options (Remember + Forgot) ── */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 13px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4b5563;
    user-select: none;
}

[data-bs-theme="dark"] .auth-checkbox {
    color: #9ca3af;
}

.auth-checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 17px;
    height: 17px;
    min-width: 17px;
    cursor: pointer;
    border-radius: 5px;
    border: 1.5px solid #d1d5db;
    background: transparent;
    transition: border-color 0.15s, background 0.15s;
}

.auth-checkbox input[type="checkbox"]:checked {
    background: rgba(0, 188, 13, 0.12);
    border-color: rgba(0, 188, 13, 0.4);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2300bc0d'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
    background-size: 13px;
    background-position: center;
    background-repeat: no-repeat;
}

[data-bs-theme="dark"] .auth-checkbox input[type="checkbox"] {
    border-color: #4b5563;
    background: transparent;
}

[data-bs-theme="dark"] .auth-checkbox input[type="checkbox"]:checked {
    background: rgba(0, 188, 13, 0.1);
    border-color: rgba(0, 188, 13, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234ade80'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
    background-size: 13px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── Links ── */
.auth-link {
    color: #00bc0d;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-link:hover {
    color: #00a00a;
    text-decoration: underline;
}

[data-bs-theme="dark"] .auth-link {
    color: #4ade80;
}

[data-bs-theme="dark"] .auth-link:hover {
    color: #86efac;
}

/* ── Submit Button (subtle-success style) ── */
.auth-button {
    width: 100%;
    padding: 13px 24px;
    background: rgba(0, 188, 13, 0.1);
    color: #00a00a;
    border: 1.5px solid rgba(0, 188, 13, 0.2);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    margin-bottom: 0.75rem;
}

.auth-button:hover {
    background: rgba(0, 188, 13, 0.16);
    border-color: rgba(0, 188, 13, 0.3);
    color: #008a09;
}

.auth-button:active {
    transform: scale(0.985);
}

[data-bs-theme="dark"] .auth-button {
    background: rgba(0, 188, 13, 0.1);
    color: #4ade80;
    border-color: rgba(0, 188, 13, 0.2);
}

[data-bs-theme="dark"] .auth-button:hover {
    background: rgba(0, 188, 13, 0.16);
    border-color: rgba(0, 188, 13, 0.3);
    color: #86efac;
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Primary Button (subtle-primary / blue) ── */
.auth-button-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.auth-button-primary:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1d4ed8;
}

[data-bs-theme="dark"] .auth-button-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] .auth-button-primary:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93bbfd;
}

/* ── Primary Link (blue) ── */
.auth-link-primary {
    color: #3b82f6;
}

.auth-link-primary:hover {
    color: #2563eb;
}

[data-bs-theme="dark"] .auth-link-primary {
    color: #60a5fa;
}

[data-bs-theme="dark"] .auth-link-primary:hover {
    color: #93bbfd;
}

/* ── Secondary Button (gray subtle) ── */
.auth-button-secondary {
    width: 100%;
    padding: 13px 24px;
    background: rgba(107, 114, 128, 0.06);
    color: #6b7280;
    border: 1.5px solid rgba(107, 114, 128, 0.2);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.auth-button-secondary:hover {
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
    color: #4b5563;
    text-decoration: none;
}

[data-bs-theme="dark"] .auth-button-secondary {
    background: rgba(156, 163, 175, 0.06);
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.15);
}

[data-bs-theme="dark"] .auth-button-secondary:hover {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.25);
    color: #d1d5db;
}

.auth-link-bold {
    color: #00bc0d;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.15s;
}

.auth-link-bold:hover {
    color: #00a00a;
    text-decoration: underline;
}

[data-bs-theme="dark"] .auth-link-bold {
    color: #4ade80;
}

[data-bs-theme="dark"] .auth-link-bold:hover {
    color: #86efac;
}

/* ── Invitation Banner ── */
.auth-invitation-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 188, 12, 0.06), rgba(0, 188, 12, 0.02));
    border: 1.5px solid rgba(0, 188, 12, 0.18);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.auth-invitation-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(0, 188, 12, 0.1);
    color: #00bc0d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-invitation-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.auth-invitation-school {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

[data-bs-theme="dark"] .auth-invitation-banner {
    background: linear-gradient(135deg, rgba(0, 188, 12, 0.08), rgba(0, 188, 12, 0.02));
    border-color: rgba(0, 188, 12, 0.2);
}

[data-bs-theme="dark"] .auth-invitation-title {
    color: #9ca3af;
}

[data-bs-theme="dark"] .auth-invitation-school {
    color: #f3f4f6;
}

/* ── Stepper ── */
.auth-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 0 8px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.auth-step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #d1d5db;
    color: #9ca3af;
    background: #fff;
    transition: all 0.2s;
}

.auth-step.active .auth-step-dot {
    border-color: rgba(0, 188, 13, 0.4);
    background: rgba(0, 188, 13, 0.1);
    color: #00a00a;
    box-shadow: 0 0 0 3px rgba(0, 188, 13, 0.08);
}

.auth-step.completed .auth-step-dot {
    border-color: rgba(0, 188, 13, 0.4);
    background: rgba(0, 188, 13, 0.1);
    color: #00a00a;
}

.auth-step-label {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.auth-step.active .auth-step-label {
    color: #1a1a1a;
}

.auth-step.completed .auth-step-label {
    color: #00bc0d;
}

.auth-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 28px;
    margin: 0 6px;
    margin-bottom: 18px;
    border-radius: 1px;
}

.auth-step-line.done {
    background: rgba(0, 188, 13, 0.35);
}

[data-bs-theme="dark"] .auth-step-dot {
    border-color: #374151;
    color: #6b7280;
    background: #1f2937;
}

[data-bs-theme="dark"] .auth-step.active .auth-step-dot,
[data-bs-theme="dark"] .auth-step.completed .auth-step-dot {
    border-color: rgba(0, 188, 13, 0.4);
    background: rgba(0, 188, 13, 0.12);
    color: #4ade80;
}

[data-bs-theme="dark"] .auth-step-label {
    color: #6b7280;
}

[data-bs-theme="dark"] .auth-step.active .auth-step-label {
    color: #f3f4f6;
}

[data-bs-theme="dark"] .auth-step-line {
    background: #2d3348;
}

/* ── Success Icon (Magic Link) ── */
.auth-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 188, 13, 0.1);
    color: #00bc0d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .auth-success-icon {
    background: rgba(0, 188, 13, 0.12);
    color: #4ade80;
}

/* ── Notice List (Magic Link) ── */
.auth-notice-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
}

[data-bs-theme="dark"] .auth-notice-list {
    color: #9ca3af;
}

/* ── Mobile ── */
@media (max-width: 576px) {
    .content {
        background: #fff;
    }

    [data-bs-theme="dark"] .content {
        background: #171a25;
    }

    .auth-wrapper {
        padding: 0;
        align-items: stretch;
        min-height: 100vh;
    }

    .auth-container {
        border-radius: 0;
        padding: 0.5rem;
        box-shadow: none;
        min-height: 100vh;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .auth-header {
        margin-bottom: 1rem;
    }

    .auth-logo {
        margin-bottom: 1rem;
    }

    .auth-input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 10px 14px 10px 40px;
    }

    .auth-input-group {
        margin-bottom: 0.5rem;
    }

    .auth-button,
    .auth-button-secondary {
        padding: 11px 20px;
        font-size: 13px;
    }

    .auth-privacy {
        padding: 10px 12px;
        margin-bottom: 1rem;
    }

    .auth-privacy .auth-checkbox {
        font-size: 12px;
    }

    .auth-options {
        margin-bottom: 1rem;
        font-size: 12px;
    }

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

    .auth-invitation-banner {
        padding: 12px 14px;
        gap: 12px;
        margin-bottom: 1rem;
    }

    .auth-invitation-school {
        font-size: 14px;
    }

    .auth-lang {
        margin-top: auto;
        padding-top: 1.5rem;
    }
}

/* ── Language Switcher ── */
.auth-lang {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 1.25rem;
}

.auth-lang-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.auth-lang-item:hover {
    color: #1a1a1a;
    background: rgba(0,0,0,.04);
    text-decoration: none;
}

.auth-lang-item.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

[data-bs-theme="dark"] .auth-lang-item {
    color: #6b7280;
}

[data-bs-theme="dark"] .auth-lang-item:hover {
    color: #f3f4f6;
    background: rgba(255,255,255,.06);
}

[data-bs-theme="dark"] .auth-lang-item.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}
