/*
 * Pagine di accesso dei due pannelli (login, password dimenticata, nuova
 * password) — layout resources/views/filament/auth/layout.blade.php.
 *
 * Modulo a sinistra, pannello di marca a destra da 1024px in su. Due aree con
 * un'identita' propria (vedi App\Filament\Support\LoginArea):
 *   .jo-auth--hotel  porta hotel, viola Joorna con le illustrazioni di Jo;
 *   .jo-auth--admin  area riservata (team e partner), scura e sobria.
 *
 * Caricato solo dal layout di accesso (non da JoornaTheme::headEndHtml()).
 * Colori dai token di joorna-tokens.css, con il valore di riserva accanto.
 */

/* ── Struttura ─────────────────────────────────────────────────────────── */

.jo-auth {
    --jo-auth-gutter: clamp(1.25rem, 4vw, 3rem);
    --jo-auth-lime: var(--jo-secondary, #cff601);
    --jo-auth-ink: #09090b;
    --jo-auth-muted: #71717a;
    --jo-auth-line: #e4e4e7;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
    color: var(--jo-auth-ink);
}

.dark .jo-auth {
    --jo-auth-ink: #fafafa;
    --jo-auth-muted: #a1a1aa;
    --jo-auth-line: rgb(255 255 255 / 0.08);

    background: #09090b;
}

@media (min-width: 1024px) {
    .jo-auth {
        grid-template-columns: minmax(440px, 5fr) 7fr;
    }
}

.jo-auth__form-col {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--jo-auth-gutter);
}

.jo-auth__usermenu {
    position: absolute;
    top: 0.75rem;
    right: var(--jo-auth-gutter);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.jo-auth__brand {
    display: inline-flex;
    align-self: flex-start;
    border-radius: 0.5rem;
}

.jo-auth__brand:focus-visible {
    outline: 2px solid var(--jo-primary-600, #7400ff);
    outline-offset: 4px;
}

.jo-auth__logo {
    display: block;
    height: 2rem;
    width: auto;
}

.jo-auth__logo--dark,
.dark .jo-auth__logo--light {
    display: none;
}

.dark .jo-auth__logo--dark {
    display: block;
}

.jo-auth__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 25rem;
    margin-inline: auto;
    padding-block: 2.5rem;
}

.jo-auth__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--jo-auth-muted);
}

.jo-auth__footer a {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--jo-auth-line);
    text-underline-offset: 3px;
}

.jo-auth__footer a:hover {
    color: var(--jo-auth-ink);
    text-decoration-color: currentColor;
}

.jo-auth__aside {
    display: none;
}

@media (min-width: 1024px) {
    .jo-auth__aside {
        display: block;
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding: 1rem 1rem 1rem 0;
    }
}

/* ── Testata del modulo ────────────────────────────────────────────────── */

.jo-auth-head {
    margin-bottom: 1.75rem;
}

.jo-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--jo-primary-50, #f5edff);
    color: var(--jo-primary-700, #5e00d6);
}

.jo-auth-eyebrow__dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 999px;
    background: currentColor;
}

.dark .jo-auth-eyebrow {
    background: rgb(116 0 255 / 0.18);
    color: var(--jo-primary-300, #b888ff);
}

.jo-auth--admin .jo-auth-eyebrow {
    background: #18181b;
    color: var(--jo-auth-lime);
}

.dark .jo-auth--admin .jo-auth-eyebrow {
    background: rgb(207 246 1 / 0.1);
}

.jo-auth-title {
    margin-top: 1rem;
    font-size: 1.875rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--jo-auth-ink);
    text-wrap: balance;
}

.jo-auth-subtitle {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--jo-auth-muted);
    text-wrap: pretty;
}

/* Controlli Filament un filo piu' generosi: e' la prima schermata di Joorna. */
.jo-auth .fi-input-wrp,
.jo-auth .fi-btn {
    border-radius: 0.625rem;
}

.jo-auth .fi-input {
    padding-block: 0.625rem;
}

.jo-auth .fi-form-actions .fi-btn {
    min-height: 2.75rem;
    font-size: 0.9375rem;
}

/* ── Link all'altra area ───────────────────────────────────────────────── */

.jo-auth-switch {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--jo-auth-line);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    color: var(--jo-auth-muted);
}

.jo-auth-switch__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--jo-primary-600, #7400ff);
    border-radius: 0.25rem;
}

.jo-auth-switch__link span {
    transition: transform 0.15s ease;
}

.jo-auth-switch__link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.jo-auth-switch__link:hover span {
    transform: translateX(2px);
}

.jo-auth-switch__link:focus-visible,
.jo-auth-back:focus-visible {
    outline: 2px solid var(--jo-primary-600, #7400ff);
    outline-offset: 2px;
}

.dark .jo-auth-switch__link {
    color: var(--jo-primary-300, #b888ff);
}

/* Dopo un accesso non riuscito: riquadro che spiega dove entrare. */
.jo-auth-switch--callout {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--jo-primary-200, #d3b3ff);
    border-radius: 0.75rem;
    background: var(--jo-primary-50, #f5edff);
    text-align: left;
    animation: jo-auth-rise 0.25s ease-out;
}

.dark .jo-auth-switch--callout {
    border-color: rgb(155 93 255 / 0.35);
    background: rgb(116 0 255 / 0.12);
}

.jo-auth-switch__icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.0625rem;
    color: var(--jo-primary-600, #7400ff);
}

.dark .jo-auth-switch__icon {
    color: var(--jo-primary-300, #b888ff);
}

.jo-auth-switch__title {
    font-weight: 600;
    color: var(--jo-auth-ink);
}

.jo-auth-switch__text {
    margin-block: 0.125rem 0.375rem;
}

/* ── Ritorno all'accesso (pagine di reset) ─────────────────────────────── */

.jo-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    align-self: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--jo-auth-muted);
    border-radius: 0.25rem;
}

.jo-auth-back:hover {
    color: var(--jo-primary-600, #7400ff);
}

.dark .jo-auth-back:hover {
    color: var(--jo-primary-300, #b888ff);
}

.jo-auth-back__icon {
    width: 1rem;
    height: 1rem;
}

.jo-auth-page {
    display: flex;
    flex-direction: column;
}

/* ── Pannello di marca (comune) ────────────────────────────────────────── */

.jo-auth-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: clamp(2rem, 3.5vw, 3.5rem);
    border-radius: 1.75rem;
    overflow: hidden;
    color: #fff;
}

.jo-auth-panel__head {
    max-width: 34rem;
}

.jo-auth-panel__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--jo-auth-lime);
}

.jo-auth-panel__kicker::before {
    content: '';
    width: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.jo-auth-panel__claim {
    margin-top: 1rem;
    font-size: clamp(2rem, 3.1vw, 3.25rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.jo-auth-panel__claim span {
    color: var(--jo-auth-lime);
}

.jo-auth-panel__lead {
    margin-top: 1rem;
    max-width: 30rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: rgb(255 255 255 / 0.78);
}

/* ── Porta hotel: viola Joorna, illustrazioni di Jo ────────────────────── */

.jo-auth-panel--hotel {
    background:
        radial-gradient(110% 80% at 100% 0%, rgb(184 136 255 / 0.55) 0%, transparent 55%),
        radial-gradient(90% 70% at 0% 100%, rgb(52 0 117 / 0.9) 0%, transparent 60%),
        linear-gradient(160deg, #7400ff 0%, #5e00d6 50%, #3d0089 100%);
}

/* Bagliore lime dietro l'illustrazione. */
.jo-auth-panel--hotel::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 58%;
    width: min(70%, 34rem);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgb(207 246 1 / 0.22) 0%, rgb(207 246 1 / 0) 65%);
}

.jo-auth-slides {
    position: relative;
    flex: 1;
    min-height: 0;
    margin-block: 1.5rem 1.25rem;
}

.jo-auth-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

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

.jo-auth-slide__art {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.jo-auth-slide__art img {
    max-width: min(100%, 30rem);
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2rem 2.5rem rgb(20 0 60 / 0.45));
    animation: jo-auth-bob 7s ease-in-out infinite;
}

.jo-auth-slide__caption {
    width: 100%;
    max-width: 28rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 1.125rem;
    background: rgb(255 255 255 / 0.1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    text-align: center;
}

.jo-auth-slide__caption strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
}

.jo-auth-slide__caption span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgb(255 255 255 / 0.8);
    text-wrap: pretty;
}

.jo-auth-dots {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.jo-auth-dot {
    position: relative;
    width: 2rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    cursor: pointer;
}

.jo-auth-dot::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.4);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.jo-auth-dot:hover::before {
    background: rgb(255 255 255 / 0.7);
}

.jo-auth-dot[aria-current='true']::before {
    width: 1.5rem;
    background: var(--jo-auth-lime);
}

.jo-auth-dot:focus-visible {
    outline: 2px solid var(--jo-auth-lime);
    outline-offset: 0;
}

/* Finestre basse: il testo prima dell'illustrazione. */
@media (max-height: 640px) {
    .jo-auth-slide__art {
        display: none;
    }

    .jo-auth-slide {
        justify-content: flex-end;
    }
}

/* ── Area riservata: scura, sobria, accento lime ───────────────────────── */

.jo-auth-panel--admin {
    background:
        radial-gradient(80% 60% at 100% 100%, rgb(116 0 255 / 0.5) 0%, transparent 60%),
        radial-gradient(60% 50% at 0% 0%, rgb(207 246 1 / 0.07) 0%, transparent 60%),
        linear-gradient(165deg, #18181b 0%, #0c0a12 100%);
}

.dark .jo-auth-panel--admin {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
}

.jo-auth-panel__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
    background-size: 3rem 3rem;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
}

.jo-auth-panel__stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-block: 1.5rem;
}

/* Anelli concentrici dietro il marchio: la "regia". */
.jo-auth-panel__stage::before {
    content: '';
    position: absolute;
    width: min(100%, 32rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: repeating-radial-gradient(circle at center, rgb(255 255 255 / 0.08) 0 1px, transparent 1px 3rem);
    -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%);
    mask-image: radial-gradient(circle, #000 25%, transparent 70%);
}

.jo-auth-panel__mark {
    position: relative;
    width: clamp(7rem, 11vw, 10rem);
    height: auto;
    border-radius: 26%;
    rotate: -8deg;
    box-shadow:
        0 2rem 3rem -1rem rgb(0 0 0 / 0.6),
        0 0 0 1px rgb(255 255 255 / 0.12),
        0 0 7rem 1rem rgb(207 246 1 / 0.2);
    animation: jo-auth-bob 7s ease-in-out infinite;
}

.jo-auth-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.25rem 1.75rem;
    margin: 0;
    padding: 1.5rem 0 0;
    border-top: 1px solid rgb(255 255 255 / 0.1);
    list-style: none;
}

.jo-auth-point {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.jo-auth-point__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: rgb(207 246 1 / 0.12);
    color: var(--jo-auth-lime);
}

.jo-auth-point__icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.jo-auth-point strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
}

.jo-auth-point strong + span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(255 255 255 / 0.66);
    text-wrap: pretty;
}

@media (max-height: 720px) {
    .jo-auth-panel__stage {
        display: none;
    }

    .jo-auth-points {
        margin-top: auto;
    }
}

/* ── Movimento ─────────────────────────────────────────────────────────── */

/* Con la proprieta' translate (non transform): si somma a rotate. */
@keyframes jo-auth-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -0.75rem; }
}

@keyframes jo-auth-rise {
    from { opacity: 0; transform: translateY(0.25rem); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .jo-auth-slide,
    .jo-auth-dot::before,
    .jo-auth-switch__link span {
        transition: none;
    }

    .jo-auth-slide__art img,
    .jo-auth-panel__mark,
    .jo-auth-switch--callout {
        animation: none;
    }
}
