/*
 * Admin sign-in pages (layouts/guest.blade.php): the B2B portal's auth split screen — a lavender silk brand panel and
 * the form on paper. Values follow travacotb2b (app/(site)/(auth)/layout.tsx, site/components/auth/ui.tsx,
 * site/components/forms/fields.tsx). Self-contained: these pages don't load the admin stylesheets.
 */

:root {
    --tvc-ink: #222141;
    --tvc-ink-hover: #34325e;
    --tvc-ink-soft: #3a3955;
    --tvc-lav: #f3dffc;
    --tvc-lav-2: #ddbef6;
    --tvc-violet: #7b4cd9;
    --tvc-cream: #f4f0ed;
    --tvc-apricot-2: #ffe2d0;
    --tvc-paper: #faf9f6;
    --tvc-line: #eeebe6;
    --tvc-input-line: #d8d2cc;
    --tvc-muted: #8a8792;
    --tvc-text-2: #6d6a75;
    --tvc-danger: #b42318;
    --tvc-danger-line: #c24126;
    --tvc-success-bg: #e6f6df;
    --tvc-success-text: #1f5a2c;
    --tvc-font: "Gabarito", system-ui, sans-serif;
    --tvc-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.tvc-auth {
    margin: 0;
    min-height: 100vh;
    background: var(--tvc-paper);
    color: var(--tvc-ink);
    font-family: var(--tvc-font);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tvc-auth *,
.tvc-auth *::before,
.tvc-auth *::after {
    box-sizing: border-box;
}

.tvc-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Layout ─────────────────────────────────────────────────────────────────────────────────────────────── */

.tvc-auth__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    min-height: 100vh;
}

/* Silk: canvas behind the panel's content */
.tvc-silk-host {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.tvc-silk-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tvc-silk-canvas[hidden] {
    display: none;
}

.tvc-silk-host > :not(.tvc-silk-canvas) {
    position: relative;
    z-index: 1;
}

/* ── Brand panel ────────────────────────────────────────────────────────────────────────────────────────── */

.tvc-auth__brand {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    padding: 3rem 3.5rem;
    /* Without WebGL: a soft lavender sheen */
    background:
        radial-gradient(560px 340px at 85% 75%, rgba(204, 168, 242, 0.8), transparent 70%),
        radial-gradient(420px 260px at 20% 110%, rgba(255, 226, 208, 0.75), transparent 70%),
        var(--tvc-lav);
}

.tvc-auth__brand.is-silk {
    background: var(--tvc-lav);
}

.tvc-auth__logo {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.375rem;
    width: max-content;
    color: var(--tvc-ink);
    text-decoration: none;
}

/* Same lockup as the admin sidebar: "Admin" on the wordmark baseline, capital as tall as the T */
.tvc-auth__logo-mark {
    display: block;
    height: 2.125rem;
    width: auto;
    color: var(--tvc-ink);
    overflow: visible;
}

.tvc-auth__logo-word {
    margin-top: 0.3875rem;
    color: var(--tvc-text-2);
    font-size: 1.5625rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.tvc-logo__bar {
    transform-box: fill-box;
    transform-origin: 83.3% 50%;
}

.tvc-auth__logo:hover .tvc-logo__bar,
.tvc-auth__logo:focus-visible .tvc-logo__bar {
    animation: tvc-logo-press 0.76s both;
}

@keyframes tvc-logo-press {
    0% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
    28% { transform: rotate(-18deg); }
    42% { transform: rotate(-18deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
    70% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

.tvc-auth__headline {
    max-width: 30rem;
    margin: 0;
    color: var(--tvc-ink);
    font-size: clamp(34px, 3.3vw, 50px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.tvc-auth__points {
    display: grid;
    gap: 0.75rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.tvc-auth__points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--tvc-ink-soft);
    font-size: 1rem;
    font-weight: 500;
}

/* The B2B portal icon tile (help centre topics): cream square, ink icon at 2px stroke */
.tvc-auth__point-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 10px;
    background: var(--tvc-cream);
    box-shadow: 0 6px 16px -12px rgba(40, 20, 70, 0.55);
    color: var(--tvc-ink);
}

.tvc-auth__point-icon .tvc-icon {
    width: 19px;
    height: 19px;
}

.tvc-auth__secure {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    color: var(--tvc-ink-soft);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── Form side ──────────────────────────────────────────────────────────────────────────────────────────── */

.tvc-auth__side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 2rem 3rem 1.75rem;
}

.tvc-auth__center {
    display: grid;
    flex: 1;
    place-items: center;
    padding: 2.5rem 0;
}

.tvc-auth__card {
    width: 100%;
    max-width: 420px;
}

/* The card's pieces rise in one after another (the B2B "b2b-stagger") */
@keyframes tvc-auth-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.tvc-auth__card > * {
    animation: tvc-auth-rise 0.5s var(--tvc-ease) both;
}

.tvc-auth__card > :nth-child(2) { animation-delay: 60ms; }
.tvc-auth__card > :nth-child(3) { animation-delay: 120ms; }
.tvc-auth__card > :nth-child(4) { animation-delay: 180ms; }
.tvc-auth__card > :nth-child(n + 5) { animation-delay: 240ms; }

.tvc-auth__pitch {
    animation: tvc-auth-rise 0.7s var(--tvc-ease) 0.1s both;
}

.tvc-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1.75rem;
    color: var(--tvc-ink-soft);
    font-size: 0.90625rem;
    font-weight: 600;
    text-decoration: none;
}

.tvc-auth__back:hover {
    color: var(--tvc-ink);
}

.tvc-auth__back .tvc-icon {
    transition: transform 0.2s var(--tvc-ease);
}

.tvc-auth__back:hover .tvc-icon {
    transform: translateX(-3px);
}

.tvc-auth__title {
    margin: 0;
    color: var(--tvc-ink);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.tvc-auth__sub {
    margin: 0.625rem 0 1.875rem;
    color: var(--tvc-ink-soft);
    font-size: 1rem;
    line-height: 1.5;
}

.tvc-auth__form {
    margin: 0;
}

.tvc-auth__field {
    display: grid;
    gap: 0.4375rem;
    margin-bottom: 1.125rem;
}

.tvc-auth__label {
    color: var(--tvc-ink);
    font-size: 0.875rem;
    font-weight: 600;
}

.tvc-auth__control {
    position: relative;
}

.tvc-auth__control-icon {
    position: absolute;
    top: 50%;
    left: 0.9375rem;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--tvc-muted);
    pointer-events: none;
    transition: color 0.15s ease;
}

.tvc-auth__control:focus-within .tvc-auth__control-icon {
    color: var(--tvc-ink);
}

.tvc-auth__input {
    width: 100%;
    height: 3.125rem;
    padding: 0 0.875rem 0 2.75rem;
    border: 1px solid var(--tvc-input-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--tvc-ink);
    font-family: var(--tvc-font);
    font-size: 0.96875rem;
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tvc-auth__input::placeholder {
    color: var(--tvc-muted);
    opacity: 1;
}

.tvc-auth__input:hover:not(:focus) {
    border-color: #c4bdb6;
}

.tvc-auth__input:focus {
    border-color: var(--tvc-violet);
    box-shadow: 0 0 0 3px rgba(123, 76, 217, 0.18);
}

.tvc-auth__input--password {
    padding-right: 3rem;
}

.tvc-auth__field.is-invalid .tvc-auth__input {
    border-color: var(--tvc-danger-line);
}

.tvc-auth__field.is-invalid .tvc-auth__input:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

.tvc-auth__error {
    margin: 0;
    color: var(--tvc-danger);
    font-size: 0.8125rem;
}

/* Show / hide password */
.tvc-auth__reveal {
    position: absolute;
    top: 50%;
    right: 0.375rem;
    display: grid;
    place-items: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--tvc-muted);
    transform: translateY(-50%);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tvc-auth__reveal:hover {
    background: var(--tvc-cream);
    color: var(--tvc-ink);
}

.tvc-auth__reveal:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(123, 76, 217, 0.25);
}

.tvc-auth__reveal .tvc-icon {
    grid-area: 1 / 1;
    width: 19px;
    height: 19px;
}

.tvc-auth__reveal-hide,
.tvc-auth__reveal.is-shown .tvc-auth__reveal-show {
    display: none;
}

.tvc-auth__reveal.is-shown .tvc-auth__reveal-hide {
    display: inline-block;
}

/* Remember me + forgot */
.tvc-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.125rem 0 1.5rem;
}

.tvc-auth__check {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--tvc-ink-soft);
    font-size: 0.875rem;
    cursor: pointer;
}

.tvc-auth__check input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    border-radius: 4px;
    accent-color: var(--tvc-ink);
    cursor: pointer;
}

.tvc-auth__link {
    color: var(--tvc-ink);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tvc-auth__link:hover {
    color: var(--tvc-violet);
}

/* Messages */
.tvc-auth__alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    background: var(--tvc-apricot-2);
    color: #6b3517;
    font-size: 0.875rem;
    line-height: 1.45;
    animation: tvc-auth-shake 0.4s var(--tvc-ease) 0.25s both;
}

.tvc-auth__alert .tvc-icon {
    margin-top: 1px;
}

.tvc-auth__alert--ok {
    background: var(--tvc-success-bg);
    color: var(--tvc-success-text);
    animation: tvc-auth-rise 0.5s var(--tvc-ease) both;
}

@keyframes tvc-auth-shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

/* Submit (B2B dark button, h-13) */
.tvc-auth__submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 12px;
    background: var(--tvc-ink);
    color: #ffffff;
    font-family: var(--tvc-font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px -14px rgba(34, 33, 65, 0.8);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tvc-auth__submit:hover {
    background: var(--tvc-ink-hover);
    box-shadow: 0 14px 26px -14px rgba(34, 33, 65, 0.85);
}

.tvc-auth__submit:active {
    transform: translateY(1px);
}

.tvc-auth__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(123, 76, 217, 0.35);
}

.tvc-auth__submit.is-busy {
    cursor: progress;
    opacity: 0.85;
}

.tvc-auth__submit.is-busy::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tvc-auth-spin 0.7s linear infinite;
}

@keyframes tvc-auth-spin {
    to { transform: rotate(360deg); }
}

/* Footer of the form side */
.tvc-auth__help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin: 0;
    color: var(--tvc-text-2);
    font-size: 0.875rem;
    text-align: center;
}

.tvc-auth__copy {
    margin: 0.375rem 0 0;
    color: var(--tvc-muted);
    font-size: 0.78125rem;
    text-align: center;
}

/* ── Older Breeze screens (confirm password, verify email, register) inside the card ──────────────────── */

.tvc-auth__card label.block.font-medium {
    margin-bottom: 0.4375rem;
    color: var(--tvc-ink) !important;
    font-size: 0.875rem;
    font-weight: 600;
}

.tvc-auth__card input.border-gray-300 {
    width: 100%;
    height: 3.125rem;
    padding: 0 0.875rem;
    border: 1px solid var(--tvc-input-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--tvc-ink);
    font-family: var(--tvc-font);
    font-size: 0.96875rem;
    box-shadow: none;
}

.tvc-auth__card input.border-gray-300:focus {
    border-color: var(--tvc-violet);
    box-shadow: 0 0 0 3px rgba(123, 76, 217, 0.18);
    outline: none;
}

.tvc-auth__card button.bg-gray-800 {
    height: 3.25rem;
    padding: 0 1.25rem;
    border-radius: 12px;
    background: var(--tvc-ink);
    font-family: var(--tvc-font);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tvc-auth__card button.bg-gray-800:hover {
    background: var(--tvc-ink-hover);
}

.tvc-auth__card :is(.text-gray-600, .text-gray-400) {
    color: var(--tvc-ink-soft) !important;
}

.tvc-auth__card ul.text-red-600 {
    margin: 0.375rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--tvc-danger) !important;
    font-size: 0.8125rem;
}

/* ── Small screens: brand panel on top, shorter ────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .tvc-auth__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tvc-auth__brand {
        position: relative;
        height: auto;
        gap: 1.5rem;
        padding: 1.75rem 1.25rem 1.875rem;
    }

    .tvc-auth__headline {
        font-size: 30px;
    }

    .tvc-auth__points {
        display: none;
    }

    .tvc-auth__secure {
        display: none;
    }

    .tvc-auth__side {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .tvc-auth__center {
        place-items: start center;
        padding: 1.75rem 0 2.25rem;
    }

    .tvc-auth__title {
        font-size: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tvc-auth *,
    .tvc-auth *::before,
    .tvc-auth *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
    }
}
