/* Login / Register pages (login.ejs, register.ejs).
   Layout: a Login | Sign Up tab switcher above a single card. The two tabs are
   real links to /login and /register — the sliding thumb and the card slide are
   a CSS-only "swipe" that plays on arrival, so the pages stay server-rendered
   and separately indexable. */
:root {
    --lr-primary: #008080;
    --lr-primary-dark: #034f5c;
    --lr-text: #1e293b;
    --lr-muted: #64748b;
    --lr-label: #626266;
    --lr-border: #e2e8f0;
    --lr-field: #f4f6f8;
    --lr-error: #dc2626;
    --lr-radius: 14px;
}

.lr-page {
    min-height: calc(100vh - 180px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 16px 60px;
    font-family: 'Poppins', sans-serif;
}
.lr-shell {
    width: 100%;
    max-width: 440px;
}

/* --- Login / Sign Up tab switcher ----------------------------------- */
.lr-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 22px;
}
.lr-tab {
    text-align: center;
    padding: 8px 0 14px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lr-muted);
    text-decoration: none;
    transition: color 0.25s ease;
}
.lr-tab.is-active { color: var(--lr-primary); }
@media (hover: hover) and (pointer: fine) {
    .lr-tab:not(.is-active):hover { color: var(--lr-text); }
}
.lr-tabs__track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--lr-border);
    overflow: hidden;
}
/* The thumb sits statically under the current tab — no slide between pages. */
.lr-tabs__thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #008181, #00a5a5);
}
.lr-tabs[data-active="register"] .lr-tabs__thumb { transform: translateX(100%); }

/* --- Card ----------------------------------------------------------- */
.lr-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 24px;
    box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.22);
    padding: 28px 26px 30px;
}
.lr-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--lr-text);
    text-align: center;
    margin: 0 0 6px;
}
.lr-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: var(--lr-muted);
    text-align: center;
    margin: 0 0 26px;
}
.lr-badge {
    display: block;
    text-align: center;
    margin-bottom: 14px;
}
.lr-badge span {
    display: inline-block;
    background: #e6f5f5;
    color: var(--lr-primary-dark);
    border: 1px solid #9fc3cc;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
}

/* --- Fields --------------------------------------------------------- */
.lr-card .form-group { margin-bottom: 16px; }
.lr-card .form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lr-label);
    margin-bottom: 7px;
}
.lr-card .input-wrapper { position: relative; }
.lr-card .form-control {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--lr-text);
    border: 1px solid transparent;
    border-radius: var(--lr-radius);
    background-color: var(--lr-field);
    box-sizing: border-box;
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lr-card .form-control::placeholder { color: #9aa3ad; }
.lr-card .form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--lr-primary);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.12);
}
.lr-card .form-control.with-icon { padding-left: 42px; padding-right: 42px; }
.lr-card .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}
.lr-card .right-icon {
    left: auto !important;
    right: 15px !important;
    cursor: pointer;
    pointer-events: auto;
}
.lr-card .password-hint {
    color: var(--lr-muted);
    font-size: 12px;
    margin-top: 6px;
}
.lr-card .error-message {
    color: var(--lr-error);
    font-size: 12.5px;
    margin-top: 6px;
    display: none;
}
.lr-forgot {
    text-align: right;
    margin: -4px 0 20px;
}
.lr-forgot a {
    color: var(--lr-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.lr-lockout {
    background-color: #fef2f2;
    border-radius: var(--lr-radius);
    padding: 12px;
    margin-bottom: 18px;
    text-align: center;
    color: var(--lr-error);
    font-size: 13.5px;
    display: none;
}

/* --- Submit --------------------------------------------------------- */
.lr-card .btn {
    width: 100%;
    height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.1s ease;
}
.lr-card .btn-primary {
    background: linear-gradient(165deg, #008181, #006b6b);
    color: #ffffff;
}
@media (hover: hover) and (pointer: fine) {
    .lr-card .btn-primary:hover { background: linear-gradient(165deg, #006b6b, #034f5c); }
}
.lr-card .btn-primary:active { transform: scale(0.99); }
.lr-card .btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}
.lr-card .spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: lrspin 1s linear infinite;
}
@keyframes lrspin { to { transform: rotate(360deg); } }

/* --- Bottom block: switch line, then divider, then social ----------- */
.lr-switch {
    text-align: center;
    margin: 18px 0 0;
    font-size: 13.5px;
    color: var(--lr-muted);
}
.lr-switch a {
    color: var(--lr-primary);
    font-weight: 700;
    text-decoration: none;
}
.lr-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 4px;
}
.lr-divider::before,
.lr-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.1);
}
.lr-divider span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lr-label);
    white-space: nowrap;
}

/* --- Entry animation -------------------------------------------------
   A plain fade, no directional movement. animation-fill-mode stays none and
   the duration is kept short: the card is the page's LCP element, and it does
   not count as painted while opacity is 0, so a long fade would push LCP out
   by its own length. If the animation never runs, the card is simply already
   at full opacity. */
@media (prefers-reduced-motion: no-preference) {
    .lr-card { animation: lr-card-in 0.25s ease-out; }
    @keyframes lr-card-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (max-width: 420px) {
    .lr-card { padding: 24px 18px 26px; border-radius: 20px; }
    .lr-title { font-size: 21px; }
}
