/*
 * Sign-in pages: a split screen with the form on the start side and a
 * showcase panel on the end side. Every accent follows the theme's primary colour.
 */

.auth-page {
    --auth-primary: var(--primary_color);
    --auth-primary-soft: color-mix(in srgb, var(--primary_color) 12%, #fff);
    --auth-primary-tint: color-mix(in srgb, var(--primary_color) 22%, #fff);
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e7e9f0;
    --auth-radius: 14px;
    background: #fff;
    color: var(--auth-ink);
    font-family: var(--kinu-font-sans);
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    min-height: 100vh;
    padding: 16px;
}

/* Form side */

.auth-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
    padding: 24px 32px;
}

.auth-header,
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo img {
    height: 40px;
    max-width: 180px;
    object-fit: contain;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-back:hover {
    color: var(--auth-ink);
}

.auth-back i {
    display: inline-flex;
    font-size: 20px;
}

.auth-body {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.auth-footer {
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--auth-ink);
}

/* Card */

.auth-card {
    width: 100%;
    max-width: 470px;
    padding: 40px 32px 32px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 48px -24px rgba(15, 23, 42, 0.18);
}

.auth-card-lg {
    max-width: 560px;
}

.auth-card-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 52%, var(--auth-primary-soft) 53%);
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--auth-primary) 55%, transparent);
    color: var(--auth-primary);
    font-size: 22px;
}

.auth-card-icon i {
    display: inline-flex;
}

.auth-title {
    margin: 0 0 8px;
    color: var(--auth-ink);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

.auth-subtitle strong {
    color: var(--auth-ink);
    font-weight: 600;
}

/* Fields */

.auth-field {
    margin-bottom: 18px;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 600;
}

.auth-link {
    color: var(--auth-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    color: var(--auth-ink);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: #a3acbd;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
    outline: none;
}

.auth-input[readonly] {
    background: #f8fafc;
    color: var(--auth-muted);
}

.auth-input.is-invalid {
    border-color: #ef4444;
}

.auth-error {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 13px;
}

.auth-password {
    position: relative;
}

.auth-password .auth-input {
    padding-inline-end: 46px;
}

.auth-password-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 4px;
    display: grid;
    place-items: center;
    width: 40px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--auth-muted);
    font-size: 17px;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--auth-ink);
}

.auth-password-toggle i {
    display: inline-flex;
}

.auth-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.auth-check {
    display: flex;
    min-height: 0;
    padding-inline-start: 0;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-check .form-check-input {
    flex-shrink: 0;
    float: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border-color: #cbd2de;
    border-radius: 5px;
    cursor: pointer;
}

.auth-check .form-check-input:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-check .form-check-input:focus {
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.auth-check label {
    cursor: pointer;
}

.auth-check a {
    color: var(--auth-primary);
}

/* Buttons */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--auth-primary) 88%, #fff), var(--auth-primary));
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--auth-primary) 80%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.auth-btn:hover {
    color: #fff;
    filter: brightness(1.06);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: 3px solid var(--auth-primary-tint);
    outline-offset: 2px;
}

.auth-btn-outline {
    background: #fff;
    border: 1px solid var(--auth-line);
    box-shadow: none;
    color: var(--auth-ink);
}

.auth-btn-outline:hover {
    background: #f8fafc;
    color: var(--auth-ink);
    filter: none;
}

.auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-alt {
    margin: 24px 0 0;
    color: var(--auth-ink);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.auth-alt .auth-link,
.auth-alt button.auth-link {
    padding: 0;
    margin-inline-start: 4px;
    background: none;
    border: 0;
    font-size: 15px;
}

/* Divider and social sign-in */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.auth-social {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.auth-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-social-btn:hover {
    background: #f8fafc;
    border-color: #d6dae4;
    color: var(--auth-ink);
}

.auth-social-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* One-time code boxes */

.auth-code {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-code input {
    width: 56px;
    height: 60px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    color: var(--auth-ink);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-code input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
    outline: none;
}

.auth-code:empty {
    display: none;
}

.auth-code-input {
    margin-bottom: 24px;
    letter-spacing: 0.5em;
    text-align: center;
}

.auth-code.is-ready + .auth-code-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
}

.auth-note {
    margin: -8px 0 20px;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

/* Showcase side */

.auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: 12vh 32px 40px;
    /* The homepage hero's background (.dark-section): its glow-and-grid image on the theme's dark colour. */
    background: var(--secondary_color) url("../../../../kinu/images/dark-section-bg-shape.png") center / cover no-repeat;
    border-radius: 24px;
}

.auth-showcase-copy {
    display: grid;
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.auth-showcase-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.auth-showcase-slide.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-showcase-title {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(28px, 2.6vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.auth-showcase-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    line-height: 1.6;
}

.auth-showcase-dots {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 32px;
}

.auth-showcase-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    background: rgba(255, 255, 255, 0.28);
    border: 0;
    border-radius: 99px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.auth-showcase-dots button.is-active {
    width: 32px;
    background: var(--auth-primary);
}

/* Dashboard illustration */

.auth-mockup {
    position: relative;
    width: 100%;
    max-width: 488px;
    margin-top: 48px;
    padding: 0 24px;
}

/* 30% larger wherever the panel has room for it; zoom keeps the width inside the panel. */
@media (min-width: 1280px) and (min-height: 870px) {
    .auth-mockup {
        zoom: 1.3;
    }
}

.auth-mockup-panel,
.auth-mockup-float {
    background: #fff;
    border-radius: var(--auth-radius);
    box-shadow: 0 24px 60px -28px rgba(15, 23, 42, 0.35);
}

.auth-mockup-panel {
    padding: 20px 22px 16px;
}

.auth-mockup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--auth-line);
}

.auth-mockup-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.auth-mockup-heading i,
.auth-mockup-select i,
.auth-mockup-trend i {
    display: inline-flex;
}

.auth-mockup-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-mockup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 0 6px;
}

.auth-mockup-stats > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.auth-mockup-label {
    display: block;
    width: 100%;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-mockup-stats strong,
.auth-mockup-float strong {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth-mockup-pill {
    padding: 2px 8px;
    background: var(--auth-primary);
    border-radius: 99px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.auth-mockup-pill-soft {
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
}

.auth-mockup-chart {
    display: block;
    width: 100%;
    height: 120px;
    margin-top: 6px;
}

.auth-mockup-chart line {
    stroke: var(--auth-line);
    stroke-width: 1;
}

.auth-mockup-chart .auth-mockup-marker {
    stroke: var(--auth-primary);
    stroke-dasharray: 3 4;
}

.auth-mockup-area {
    fill: var(--auth-primary-soft);
}

.auth-mockup-line {
    fill: none;
    stroke: var(--auth-primary);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.auth-mockup-dot {
    fill: var(--auth-primary);
    stroke: #fff;
    stroke-width: 3;
}

.auth-mockup-months {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-mockup-float {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
}

.auth-mockup-float-start {
    top: 170px;
    inset-inline-start: 0;
    width: 180px;
}

.auth-mockup-float-end {
    inset-inline-end: 0;
    bottom: -48px;
    width: 170px;
    align-items: center;
    text-align: center;
}

.auth-mockup-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-mockup-float-start .auth-mockup-trend {
    color: var(--auth-primary);
}

.auth-mockup-gauge {
    width: 110px;
    margin: 6px 0 -18px;
}

.auth-mockup-gauge path {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
}

.auth-mockup-gauge-track {
    stroke: var(--auth-primary-soft);
}

.auth-mockup-gauge-fill {
    stroke: var(--auth-primary);
    stroke-dasharray: 72 100;
}

@media (prefers-reduced-motion: reduce) {
    .auth-showcase-slide,
    .auth-showcase-dots button {
        transition: none;
    }
}

/* Smaller screens: the form takes the whole page. */

@media (max-width: 1099.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
        padding: 0;
    }

    .auth-showcase {
        display: none;
    }

    .auth-main {
        min-height: 100vh;
    }
}

@media (max-width: 575.98px) {
    .auth-main {
        padding: 20px 16px;
    }

    .auth-body {
        padding: 28px 0;
    }

    .auth-card {
        padding: 28px 20px 24px;
        border: 0;
        box-shadow: none;
    }

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

    .auth-row,
    .auth-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-code {
        gap: 8px;
    }

    .auth-code input {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }

    .auth-footer {
        flex-direction: column;
        gap: 6px;
    }
}
