/* ---------------------------------------------------------------------------
   Lens authentication — customer-facing.

   Shares the palette and type of the rest of the site (Fraunces display,
   Inter body, deep navy ground with blue/teal accents) so the check reads as
   part of Lumiks rather than a bolted-on utility.
   ------------------------------------------------------------------------- */

.lv {
    --lv-bg:        #050816;
    --lv-panel:     rgba(15, 23, 42, 0.62);
    --lv-border:    rgba(147, 197, 253, 0.16);
    --lv-text:      #e2e8f0;
    --lv-muted:     #94a3b8;
    --lv-heading:   #ffffff;
    --lv-primary:   #3b82f6;
    --lv-teal:      #5eead4;
    --lv-ok:        #34d399;
    --lv-bad:       #f87171;

    position: relative;
    isolation: isolate;
    padding: clamp(48px, 8vw, 96px) 20px clamp(64px, 9vw, 112px);
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, #0B1120 0%, #050816 55%, #020308 100%);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--lv-text);
    overflow: hidden;
}

/* Slow-moving colour wash behind the panel. */
.lv__aurora {
    position: absolute;
    inset: -30% -20% auto -20%;
    height: 70%;
    z-index: -1;
    background:
        radial-gradient(closest-side, rgba(59, 130, 246, 0.20), transparent 70%) 20% 30% / 55% 70% no-repeat,
        radial-gradient(closest-side, rgba(94, 234, 212, 0.14), transparent 70%) 78% 20% / 48% 62% no-repeat;
    filter: blur(18px);
    animation: lv-drift 22s ease-in-out infinite alternate;
}

@keyframes lv-drift {
    from { transform: translate3d(-2%, 0, 0) scale(1); }
    to   { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.lv__inner {
    max-width: 720px;
    margin: 0 auto;
}

/* --- Intro ---------------------------------------------------------------- */
.lv__intro { text-align: center; margin-bottom: clamp(32px, 5vw, 48px); }

.lv__eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--lv-teal);
    margin-bottom: 18px;
    padding: 6px 14px;
    border: 1px solid rgba(94, 234, 212, 0.28);
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.06);
}

.lv__title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(2rem, 6vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--lv-heading);
    margin: 0 0 18px;
}

.lv__title em {
    font-style: italic;
    background: linear-gradient(100deg, #93c5fd, var(--lv-teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lv__lede {
    max-width: 54ch;
    margin: 0 auto;
    color: var(--lv-muted);
    font-size: clamp(0.98rem, 1.6vw, 1.08rem);
    line-height: 1.75;
}

/* --- Panel ----------------------------------------------------------------- */
.lv__panel {
    background: var(--lv-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--lv-border);
    border-radius: 22px;
    padding: clamp(26px, 4.5vw, 44px);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.55);
}

.lv__panel-heading {
    margin: 0 0 22px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lv-muted);
}

/* --- Code boxes ------------------------------------------------------------ */
.lv__code {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: clamp(5px, 1.4vw, 10px);
    margin-bottom: 14px;
}

.lv__char {
    width: 100%;
    aspect-ratio: 3 / 4;
    min-width: 0;
    padding: 0;
    text-align: center;
    font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
    font-size: clamp(1.05rem, 4.2vw, 1.7rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--lv-heading);
    background: rgba(2, 6, 23, 0.55);
    border: 1.5px solid var(--lv-border);
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.lv__char:hover { border-color: rgba(147, 197, 253, 0.34); }

.lv__char:focus {
    outline: none;
    border-color: var(--lv-primary);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
    transform: translateY(-2px);
}

.lv__char.is-filled { border-color: rgba(94, 234, 212, 0.45); background: rgba(94, 234, 212, 0.07); }

.lv__code.is-invalid .lv__char {
    border-color: rgba(248, 113, 113, 0.55);
    animation: lv-shake 0.4s ease;
}

@keyframes lv-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

.lv__hint {
    margin: 0 0 22px;
    text-align: center;
    font-size: 0.83rem;
    color: var(--lv-muted);
}

/* --- Submit ---------------------------------------------------------------- */
.lv__submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(100deg, var(--lv-primary), #2563eb);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.32);
}

.lv__submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(37, 99, 235, 0.44); }
.lv__submit:active:not(:disabled) { transform: translateY(0); }
.lv__submit:disabled { opacity: 0.6; cursor: progress; }

.lv__spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lv-spin 0.7s linear infinite;
}

.lv__submit.is-busy .lv__spinner { display: block; }

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

/* --- Result ---------------------------------------------------------------- */
.lv__result:empty { display: none; }

.lv__result { margin-top: 26px; }

.lv__card {
    border-radius: 16px;
    padding: clamp(20px, 3.5vw, 28px);
    animation: lv-rise 0.45s cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes lv-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lv__card--ok  { background: rgba(52, 211, 153, 0.09); border: 1px solid rgba(52, 211, 153, 0.32); }
.lv__card--bad { background: rgba(248, 113, 113, 0.09); border: 1px solid rgba(248, 113, 113, 0.32); }

.lv__card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.lv__seal {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}
.lv__card--ok  .lv__seal { background: rgba(52, 211, 153, 0.16);  color: var(--lv-ok); }
.lv__card--bad .lv__seal { background: rgba(248, 113, 113, 0.16); color: var(--lv-bad); }
.lv__seal svg { width: 24px; height: 24px; }

.lv__card-title {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.15rem, 3.4vw, 1.45rem);
    font-weight: 600;
    line-height: 1.25;
    color: var(--lv-heading);
}

.lv__card-sub { margin: 3px 0 0; font-size: 0.86rem; color: var(--lv-muted); }

.lv__facts { display: grid; gap: 1px; background: rgba(148, 163, 184, 0.14); border-radius: 12px; overflow: hidden; }

.lv__fact {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 13px 16px;
    background: rgba(2, 6, 23, 0.42);
    font-size: 0.94rem;
}

.lv__fact dt { margin: 0; color: var(--lv-muted); font-size: 0.82rem; letter-spacing: 0.02em; }
.lv__fact dd { margin: 0; color: var(--lv-heading); font-weight: 600; text-align: right; word-break: break-word; }

/* Prescription table */
.lv__rx { margin-top: 18px; }

.lv__rx-label {
    margin: 0 0 9px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--lv-muted);
}

.lv__rx-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.88rem;
    background: rgba(2, 6, 23, 0.42);
    border-radius: 12px;
    overflow: hidden;
}

.lv__rx-table th,
.lv__rx-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.lv__rx-table tr:last-child td { border-bottom: none; }

.lv__rx-table thead th {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lv-muted);
    font-weight: 600;
    background: rgba(148, 163, 184, 0.07);
}

.lv__rx-table tbody th {
    font-family: 'Inter', sans-serif;
    color: var(--lv-teal);
    font-weight: 700;
    width: 46px;
}

.lv__rx-table td { color: var(--lv-heading); }

.lv__note {
    margin: 18px 0 0;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    background: rgba(52, 211, 153, 0.1);
    color: #a7f3d0;
}

.lv__card--bad .lv__note { background: rgba(248, 113, 113, 0.1); color: #fecaca; }

.lv__retry {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    background: transparent;
    color: var(--lv-text);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}
.lv__retry:hover { background: rgba(59, 130, 246, 0.16); }

/* --- Help ------------------------------------------------------------------ */
.lv__help {
    margin-top: 22px;
    border: 1px solid var(--lv-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.4);
    overflow: hidden;
}

.lv__help summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--lv-text);
    list-style: none;
}

.lv__help summary::-webkit-details-marker { display: none; }
.lv__help summary:hover { color: var(--lv-heading); }

.lv__help summary svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.22s ease; color: var(--lv-muted); }
.lv__help[open] summary svg { transform: rotate(180deg); }

.lv__help-body {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 20px;
    padding: 0 20px 22px;
    align-items: start;
}

.lv__help-body p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.7; color: var(--lv-muted); }
.lv__help-body p:last-child { margin-bottom: 0; }
.lv__help-body a { color: #93c5fd; }

/* Miniature of the printed card, so the customer knows what to look for. */
.lv__help-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 12px;
    background: #f8fafc;
    border-radius: 8px;
    color: #0f172a;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    text-align: center;
}

.lv__help-card-top { font-size: 0.52rem; letter-spacing: 0.06em; border: 1px solid #0f172a; padding: 4px; }
.lv__help-card-code {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    border: 2px solid var(--lv-primary);
    border-radius: 4px;
    padding: 7px 4px;
    background: rgba(59, 130, 246, 0.1);
}
.lv__help-card-row { display: flex; justify-content: space-between; font-size: 0.5rem; border: 1px solid #0f172a; padding: 4px 6px; }

/* --- Assurances ------------------------------------------------------------- */
.lv__assurances {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.lv__assurances li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--lv-border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.34);
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--lv-muted);
}

.lv__assurances svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--lv-teal); margin-top: 1px; }
.lv__assurances strong { display: block; color: var(--lv-heading); font-weight: 600; margin-bottom: 2px; }

/* Visible to screen readers only — used for the unlabelled eye column. */
.lv-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Responsive -------------------------------------------------------------- */
@media (max-width: 560px) {
    .lv__code { gap: 4px; }
    .lv__char { border-radius: 9px; }
    .lv__help-body { grid-template-columns: 1fr; }
    .lv__help-card { max-width: 200px; margin: 0 auto; }
    .lv__fact { flex-direction: column; gap: 3px; }
    .lv__fact dd { text-align: left; }
    .lv__rx-table { font-size: 0.8rem; }
    .lv__rx-table th, .lv__rx-table td { padding: 8px 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .lv__aurora,
    .lv__card,
    .lv__code.is-invalid .lv__char,
    .lv__spinner { animation: none; }
    .lv__char:focus,
    .lv__submit:hover:not(:disabled) { transform: none; }
}
