/* ============================================================
   Learning Sphere — authentication screens (login + password reset)
   Palette : coral gradient #ff9a56 → #ff6b6b → #c44569 (brand accent)
             ink #1A1714 · porcelain #FAF8F4 · slate #6B6560
   Type    : Cabinet Grotesk (display) · IBM Plex Sans (UI) · IBM Plex Mono (labels)
   ============================================================ */

:root {
    --ls-ink: #1A1714;
    --ls-g1: #ff9a56;
    --ls-g2: #ff6b6b;
    --ls-g3: #c44569;
    --ls-porcelain: #FAF8F4;
    --ls-slate: #6B6560;
    --ls-border: rgba(26, 23, 20, .12);
    --ls-radius: 16px;
    /* the brand gradient, defined once */
    --ls-gradient: linear-gradient(135deg, var(--ls-g1) 0%, var(--ls-g2) 50%, var(--ls-g3) 100%);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-y: auto;
    color: var(--ls-ink);
    /* porcelain backdrop with a faint coral wash so the card reads as elevated */
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 154, 86, 0.07) 0%, transparent 38%),
        radial-gradient(circle at 88% 88%, rgba(196, 69, 105, 0.06) 0%, transparent 40%),
        var(--ls-porcelain);
}

.login-container {
    position: relative;
    display: flex;
    min-height: 70vh;
    max-height: calc(100vh - 48px);
    max-width: 1060px;
    margin: clamp(16px, 11vh, 96px) auto 16px;
    background: #fff;
    border: 1px solid var(--ls-border);
    border-radius: var(--ls-radius);
    box-shadow: 0 30px 70px -20px rgba(26, 23, 20, 0.30);
    overflow: hidden;
}

/* Brand accent bar across the top of the card */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ls-g1), var(--ls-g2) 55%, var(--ls-g3));
    z-index: 3;
}

/* Left side - Login Form */
.login-form-section {
    flex: 1;
    padding: 64px 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.login-header {
    text-align: center;
    margin-bottom: 34px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.logo-container svg {
    max-width: 100%;
    height: auto;
}

.login-header h1 {
    font-family: 'Cabinet Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: -0.02em;
    color: var(--ls-ink);
    margin-bottom: 10px;
}

.login-header p {
    font-size: 15px;
    color: var(--ls-slate);
    font-weight: 400;
    line-height: 1.5;
}

/* Form Styles */
form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ls-slate);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--ls-border);
    border-radius: 11px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ls-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background-color: var(--ls-porcelain);
    outline: none;
}

.form-control:focus {
    border-color: var(--ls-g1);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 154, 86, 0.18);
}

.form-control::placeholder {
    color: #a39d97;
}

/* Keep the porcelain background (and dark text) when the browser autofills,
   so the leading icon stays visible instead of being masked by the blue tint. */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ls-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--ls-porcelain) inset;
    caret-color: var(--ls-ink);
    transition: background-color 9999s ease 0s;
}

/* Field wrapper + overlay icons (injected by /js/password-toggle.js).
   Icons are real elements, so they survive autofill and password show/hide. */
.input-field {
    position: relative;
}

/* fields that get a leading icon reserve room on the left */
.input-field .form-control {
    padding-left: 48px;
}

/* password fields also reserve room on the right for the eye toggle */
.form-control.has-eye {
    padding-right: 48px;
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: var(--ls-slate);
    pointer-events: none;
}

.field-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--ls-slate);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover {
    color: var(--ls-ink);
    background: rgba(26, 23, 20, 0.05);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--ls-g1);
    outline-offset: 1px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* show the relevant icon based on state */
.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

/* Login Button */
.btn-login {
    position: relative;
    width: 100%;
    padding: 15px;
    background: var(--ls-gradient);
    color: #fff;
    border: none;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    margin: 6px 0 20px;
    overflow: hidden;
}

/* subtle top sheen */
.btn-login::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    pointer-events: none;
}

/* Keep the label white in every interaction state. The button is `btn btn-login`,
   and Bootstrap's hover/active/focus rules (e.g. `.btn:first-child:active`) would
   otherwise reset the text to its dark default. The `.btn.btn-login` prefix matches
   Bootstrap's specificity, and login.css loads after Bootstrap so it wins. */
.btn.btn-login:hover,
.btn.btn-login:focus,
.btn.btn-login:focus-visible,
.btn.btn-login:active,
.btn.btn-login.active {
    color: #fff;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(255, 107, 107, 0.32);
}

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

/* Forgot Password */
.forgot-password {
    text-align: center;
}

.forgot-password a {
    color: var(--ls-slate);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.forgot-password a:hover {
    color: var(--ls-g2);
    text-decoration: underline;
}

/* Right side - Brand Panel */
.login-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 56px;
    color: #fff;
    position: relative;
    overflow: hidden;
    /* brand gradient with a soft diagonal sheen for depth */
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.16) 0%, transparent 55%),
        var(--ls-gradient);
}

.info-content {
    position: relative;
    z-index: 2;
    text-align: left;
    max-width: 420px;
}

/* accent rule above the heading */
.info-content::before {
    content: '';
    display: block;
    width: 52px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.85);
    margin-bottom: 26px;
}

.info-eyebrow {
    display: inline-block;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 18px;
}

.info-content h2 {
    font-family: 'Cabinet Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    line-height: 1.12;
}

.info-content p {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
}

/* Brand feature list (optional, used on login screen) */
.info-features {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
}

.info-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.info-features li:first-child {
    border-top: none;
}

.info-features li::before {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: #fdecea;
    color: #b42318;
    border: 1px solid #f6c9c4;
}

/* User Info (when logged in) */
.user-info {
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.10) 0%, rgba(255, 107, 107, 0.10) 100%);
    border: 1px solid rgba(255, 154, 86, 0.30);
    border-radius: 11px;
    padding: 16px;
    margin-bottom: 20px;
    color: var(--ls-ink);
}

.user-info a {
    color: var(--ls-g2);
    text-decoration: none;
    font-weight: 600;
}

.user-info a:hover {
    color: var(--ls-g3);
    text-decoration: underline;
}

/* Single column layout for reset pages */
.reset-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: 470px;
    margin: clamp(16px, 11vh, 96px) auto 16px;
    background: #fff;
    padding: 60px 64px;
    border: 1px solid var(--ls-border);
    box-shadow: 0 30px 70px -20px rgba(26, 23, 20, 0.30);
    text-align: center;
    border-radius: var(--ls-radius);
    overflow: hidden;
}

.reset-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ls-g1), var(--ls-g2) 55%, var(--ls-g3));
}

.reset-container .login-header {
    margin-bottom: 36px;
}

.reset-container form {
    width: 100%;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        margin: 0;
    }

    .login-form-section {
        padding: 48px 28px;
        order: 2;
    }

    .login-info-section {
        padding: 52px 28px;
        min-height: 240px;
        order: 1;
    }

    .login-header h1,
    .info-content h2 {
        font-size: 26px;
    }

    .info-features {
        display: none;
    }

    .reset-container {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }
}

@media (max-height: 720px) {
    .login-container {
        min-height: auto;
        max-height: none;
    }

    .login-form-section,
    .login-info-section {
        padding: 38px 44px;
    }

    .reset-container {
        padding: 42px 44px;
    }
}
