/* Sign-in: split-screen layout on the Kaayu design system (docs/kaayu-design-system-light.html).
   Left: brand panel on the "energy" gradient with the hero grid. Right: the form on white.
   Scoped with the ks- prefix so nothing here leaks into Velzon's auth pages. */

:root {
    --ks-teal-900: #003544;
    --ks-teal-700: #004D63;
    --ks-teal: #02627F;
    --ks-teal-400: #00799C;
    --ks-cyan: #00AFE1;
    --ks-danger: #C01F3D;
    --ks-ink: #1A1C1E;
    --ks-slate: #4A5568;
    --ks-muted: #94A3B8;
    --ks-surface: #F4F9FA;
    --ks-border: rgba(0, 0, 0, 0.10);
    --ks-radius: 12px;
}

.ks-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: #fff;
    color: var(--ks-ink);
    font-family: 'Heebo', sans-serif;
}

/* ── Brand panel ─────────────────────────────────────────────── */
.ks-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 48px 56px;
    color: #fff;
    background: linear-gradient(135deg, #003544 0%, #02627F 45%, #00799C 100%);
}

/* The design system's hero grid, drawn in white and faded toward the edges. */
.ks-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 100%);
    pointer-events: none;
}

/* One cyan glow, low and to the right, where the quotes sit. */
.ks-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 45% at 85% 90%, rgba(0, 175, 225, 0.28) 0%, transparent 60%);
    pointer-events: none;
}

.ks-brand > * {
    position: relative;
    z-index: 1;
}

.ks-brand__logo img {
    height: 22px;
    width: auto;
    display: block;
}

.ks-brand__gym {
    margin: auto 0;
    padding: 40px 0;
}

.ks-brand__chip {
    display: inline-block;
    background: #fff;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.ks-brand__chip img {
    display: block;
    max-height: 56px;
    max-width: 220px;
    object-fit: contain;
}

.ks-brand__name {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 20px 0 0;
}

.ks-brand__name:empty {
    display: none;
}

/* The one loud element on the page: a single Syne statement. */
.ks-brand__headline {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 4.6vw, 3.9rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 28px;
    max-width: 12ch;
}

/* Second line in the design system's cyan-to-light text gradient (hero treatment). */
.ks-brand__accent {
    background: linear-gradient(135deg, #00AFE1 0%, #7FD8F7 55%, #C8EBFE 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #00AFE1;
}

.ks-brand__quotes .carousel-inner {
    font-family: 'Heebo', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
    min-height: 3.2em;
}

.ks-brand__quotes .carousel-item p {
    margin: 0;
    max-width: 44ch;
}

.ks-brand__quotes .carousel-indicators {
    position: static;
    justify-content: flex-start;
    margin: 20px 0 0;
}

.ks-brand__quotes .carousel-indicators [data-bs-target] {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    border: 0;
    opacity: 1;
    margin: 0 6px 0 0;
}

.ks-brand__quotes .carousel-indicators .active {
    background: var(--ks-cyan);
}

.ks-brand__foot {
    margin-top: 32px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.72);
}

/* ── Form panel ──────────────────────────────────────────────── */
.ks-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #fff;
}

.ks-form__inner {
    width: 100%;
    max-width: 420px;
}

.ks-form__title {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 2.25rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ks-ink);
    margin: 0 0 8px;
}

.ks-form__lead {
    color: var(--ks-slate);
    font-size: 1rem;
    margin: 0 0 32px;
}

.ks-flash {
    background: #EBF5F8;
    border: 1px solid rgba(2, 98, 127, 0.22);
    color: var(--ks-teal-900);
    border-radius: var(--ks-radius);
    padding: 12px 16px;
    margin: 0 0 24px;
}

.ks-field {
    margin-bottom: 20px;
}

.ks-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ks-slate);
    margin-bottom: 8px;
}

.ks-input.form-control {
    height: 52px;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 0 16px;
    font-family: 'Heebo', sans-serif;
    font-size: 1rem;
    color: var(--ks-ink);
    background: #fff;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ks-input.form-control::placeholder {
    color: var(--ks-muted);
}

.ks-input.form-control:focus {
    border-color: var(--ks-teal);
    box-shadow: 0 0 0 3px rgba(2, 98, 127, 0.12);
    outline: 0;
}

.ks-input.form-control.is-invalid {
    border-color: var(--ks-danger);
    background-image: none;
    padding-right: 16px;
}

.ks-input.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 31, 61, 0.12);
}

.ks-form .invalid-feedback {
    color: var(--ks-danger);
    font-size: 0.85rem;
    margin-top: 6px;
}

.ks-password {
    position: relative;
}

.ks-password .ks-input.form-control {
    padding-right: 52px;
}

.ks-eye {
    position: absolute;
    top: 0;
    right: 0;
    height: 52px;
    width: 52px;
    border: 0;
    background: transparent;
    color: var(--ks-muted);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ks-radius);
}

.ks-eye:hover,
.ks-eye:focus-visible {
    color: var(--ks-teal);
    outline: 0;
}

.ks-link {
    color: var(--ks-teal);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
}

.ks-link:hover,
.ks-link:focus-visible {
    color: var(--ks-teal-700);
    text-decoration: underline;
}

/* The design system's gold CTA gradient; dark text keeps it readable (AA) on the lighter gold. */
.ks-btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 9999px;
    background: linear-gradient(135deg, #DCA510 0%, #B18204 100%);
    color: var(--ks-teal-900);
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(177, 130, 4, 0.30);
    transition: box-shadow .25s cubic-bezier(.4, 0, .2, 1), transform .25s cubic-bezier(.4, 0, .2, 1), filter .25s;
}

.ks-btn:hover {
    color: var(--ks-teal-900);
    box-shadow: 0 8px 28px rgba(177, 130, 4, 0.42);
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.ks-btn:focus-visible {
    outline: 3px solid rgba(177, 130, 4, 0.45);
    outline-offset: 3px;
}

.ks-btn:disabled {
    opacity: 0.75;
    transform: none;
}

.ks-note {
    margin: 32px 0 0;
    text-align: center;
    color: var(--ks-slate);
    font-size: 0.9rem;
}

/* ── Standalone pages (member portal: no Bootstrap) ─────────────── */
.ks-auth *,
.ks-auth *::before,
.ks-auth *::after {
    box-sizing: border-box;
}

.ks-auth {
    margin: 0;
}

.ks-input.form-control {
    display: block;
    width: 100%;
}

.ks-form .invalid-feedback {
    display: block;
}

.ks-flash--error {
    background: #FDECEA;
    border-color: rgba(192, 31, 61, 0.25);
    color: #740018;
}

.ks-brand__sub {
    font-family: 'Heebo', sans-serif;
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
    max-width: 44ch;
    margin: 0;
}

.ks-brand__statement {
    margin-top: auto;
}

.ks-brand__gym + .ks-brand__statement {
    margin-top: 0;
}

.ks-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: var(--ks-slate);
    cursor: pointer;
}

.ks-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ks-teal);
}

.ks-hint {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: var(--ks-muted);
    margin: 6px 0 0;
}

.ks-center {
    display: flex;
    justify-content: center;
}

/* Forgot-password mailbox icon */
.ks-icon {
    margin-bottom: 12px;
}

/* New-password rules; .valid / .invalid are toggled by the page script */
.ks-checklist {
    list-style: none;
    margin: -4px 0 20px;
    padding: 14px 16px;
    background: var(--ks-surface);
    border: 1px solid rgba(2, 98, 127, 0.12);
    border-radius: var(--ks-radius);
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    color: var(--ks-slate);
}

.ks-checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.ks-checklist li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ks-muted);
    flex-shrink: 0;
}

.ks-checklist li.valid {
    color: var(--ks-teal-900);
}

.ks-checklist li.valid::before {
    background: #22C55E;
}

/* ── Small screens: brand panel becomes a band above the form ── */
@media (max-width: 991.98px) {
    .ks-auth {
        grid-template-columns: 1fr;
    }

    .ks-brand {
        padding: 28px 24px 32px;
    }

    .ks-brand__gym {
        margin: 24px 0 0;
        padding: 0;
    }

    .ks-brand__name {
        font-size: 1.75rem;
        margin-top: 14px;
    }

    .ks-brand__headline {
        font-size: 2rem;
        margin: 20px 0 0;
    }

    .ks-brand__quotes,
    .ks-brand__sub,
    .ks-brand__foot {
        display: none;
    }

    .ks-form {
        padding: 36px 20px 48px;
        align-items: flex-start;
    }

    .ks-form__title {
        font-size: 1.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ks-btn,
    .ks-input.form-control {
        transition: none;
    }

    .ks-btn:hover {
        transform: none;
    }
}
