﻿/* ═══════════════════════════════════════════════════════════
   SETUP SCREENS — setup.css
   Extracted from style.css for modular separation.
═══════════════════════════════════════════════════════════ */

/* Setup Screen - Phone Optimized */
.setup-screen {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f1f1f1;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    padding: 20px;
}

.setup-screen.active {
    display: flex;
}

.setup-content {
    text-align: center;
    color: #333;
    width: 100%;
    max-width: 260px;
}

.sbf-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    margin-bottom: 46px;
    margin-left: 10px;
}

.setup-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.setup-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

@font-face {
    font-family: 'Borel-Regular';
    src: url('../../assets/fonts/Borel-Regular.ttf') format('truetype');
}

.hello__div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px auto;
    text-align: center;
    width: 100%;
    overflow: hidden;
}

.hello__canvas {
    display: block;
    /* Width/height set dynamically by _drawHelloGlass() */
}

/* ── Language screen header: globe icon ─────────────────── */
.lang-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    padding-bottom: 50px;
    flex-shrink: 0;
    width: 100%;
}

.lang-globe-icon {
    width: 68px;
    height: 68px;
}

/* ── Scrollable list wrapper ─────────────────────────────── */
.lang-list-wrap {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    padding: 0 25px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lang-list-wrap::-webkit-scrollbar {
    display: none;
}

/* iOS 26 Liquid Glass — list container */
.lang-list {
    padding: 6px;
    border-radius: 20px;
    background: rgb(187 187 188 / 31%);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.55),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.80),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.40),
        0 2px 10px 0           rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Individual row ──────────────────────────────────────── */
.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 14px;
    border-radius: 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    position: relative;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 0;
    height: 0.5px;
    background: rgba(0, 0, 0, 0.10);
}

.lang-item:hover {
    background: rgba(187, 187, 188, 0.22);
}

.lang-item.selected {
    background: rgba(187, 187, 188, 0.30);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.lang-item.selected .lang-item-name {
    color: #007AFF;
    font-weight: 600;
}

.lang-item.selected .lang-item-chevron {
    color: #007AFF;
}

.lang-item-name {
    font-size: 17px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.82);
}

.lang-item-chevron {
    font-size: 20px;
    color: rgba(0, 0, 0, 0.28);
    font-weight: 300;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Footer: continue button removed — navigation is direct on lang-item tap */



/* Theme Selection Screen - same look as language screen */
.theme-screen {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f1f1f1;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    z-index: 1200;
    overflow: hidden;
    padding: 0;
}

.theme-screen.active {
    display: flex;
}

.theme-screen.slide-out {
    animation: slideOutToLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ── Appearance header ───────────────────────────────── */
.appearance-header {
    padding: 72px 28px 0 28px;
    flex-shrink: 0;
}

.theme-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1c1c1e;
    line-height: 1.15;
    margin-top: 25px;
}

.theme-subtitle {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.60);
    margin: 0;
    line-height: 1.45;
}

.size-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1c1c1e;
    line-height: 1.15;
    margin-top: 25px;
}

.size-subtitle {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.60);
    margin: 0;
    line-height: 1.45;
}

/* ── Calculator preview inside phone frame ───────────── */
.appearance-preview-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 0px 0;
    flex: 1;
    min-height: 0;
    max-height: 340px;
    overflow: visible;
}

.appearance-preview-wrap--size {
    flex: 1;
    align-items: flex-start;
    padding-top: 32px;
}

/* Phone-shaped outer frame — same look as the old mock */
.calc-phone-frame {
    position: relative;
    width: 114px;
    height: 213px;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
    outline: 3px solid rgba(0, 0, 0, 0.78);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.55),
        inset 1.5px 3px 0 -1px rgba(255, 255, 255, 0.80),
        inset -1px -1.5px 0 -1px rgba(255, 255, 255, 0.35),
        0 10px 32px 0          rgba(0, 0, 0, 0.36),
        0 3px 8px 0            rgba(0, 0, 0, 0.20);
    display: flex;
    flex-direction: column;
}

/* Dynamic-island style notch */
.calc-phone-notch {
    flex-shrink: 0;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c1e;
    transition: background-color 0.30s ease;
}
.calc-phone-notch::after {
    content: '';
    width: 42px;
    height: 11px;
    background: #000;
    border-radius: 99em;
}

/* Calc preview fills remaining space */
.calc-preview {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* CSS vars sized for 114px frame */
    --cp-btn: 22px;
    --cp-gap: 4px;
    --cp-px:  7px;
    --cp-font: 16px;
}

/* Home indicator bar at bottom */
.calc-phone-home {
    flex-shrink: 0;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c1e;
    transition: background-color 0.30s ease;
}
.calc-phone-home::after {
    content: '';
    width: 38px;
    height: 3px;
    border-radius: 99em;
    background: rgba(150, 150, 150, 0.55);
}

.calc-preview-app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: background-color 0.30s ease;
}

.calc-preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--cp-px) 8px var(--cp-px);
    gap: 2px;
}

.calc-preview-display {
    font-size: var(--cp-font);
    font-weight: 300;
    text-align: right;
    padding: 4px 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    transition: color 0.30s ease;
    letter-spacing: -0.5px;
}

.calc-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, var(--cp-btn));
    grid-auto-rows: var(--cp-btn);
    gap: var(--cp-gap);
    justify-content: center;
}

/* Base button */
.cpb {
    border: none;
    border-radius: 50%;
    font-size: calc(var(--cp-btn) * 0.38);
    font-weight: 500;
    height: var(--cp-btn);
    width: var(--cp-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    transition: background-color 0.30s ease, color 0.30s ease;
}

/* Wide "0" pill */
.cpb-zero {
    grid-column: span 2;
    border-radius: calc(var(--cp-btn) / 2);
    width: calc(var(--cp-btn) * 2 + var(--cp-gap));
    justify-content: flex-start;
    padding-left: calc(var(--cp-btn) * 0.38);
}

/* Operator / equals — same in both themes */
.cpb-op,
.cpb-eq {
    background: #ff9500;
    color: #ffffff;
}

/* ── Dark theme (default) ───────────── */
.calc-phone-frame.preview-dark .calc-phone-notch::before,
.calc-phone-frame.preview-dark .calc-phone-home {
    background: #1c1c1e;
}
.calc-phone-frame.preview-dark .calc-phone-notch { background: #1c1c1e; }
.calc-phone-frame.preview-dark .calc-phone-home  { background: #1c1c1e; }
.calc-preview.preview-dark .calc-preview-app     { background: #1c1c1e; }
.calc-preview.preview-dark .calc-preview-display { color: #ffffff; }
.calc-preview.preview-dark .cpb-num              { background: #333333; color: #ffffff; }
.calc-preview.preview-dark .cpb-clear            { background: #a6a6a6; color: #000000; }

/* ── Light theme ────────────────────── */
.calc-phone-frame.preview-light .calc-phone-notch { background: #f2f2f7; }
.calc-phone-frame.preview-light .calc-phone-home  { background: #f2f2f7; }
.calc-preview.preview-light .calc-preview-app     { background: #f2f2f7; }
.calc-preview.preview-light .calc-preview-display { color: #1c1c1e; }
.calc-preview.preview-light .cpb-num              { background: #d4d4d8; color: #1c1c1e; }
.calc-preview.preview-light .cpb-clear            { background: #a5a5aa; color: #1c1c1e; }

/* ── Moon / Sun category slider ──────────────────────── */
.theme-category-wrap {
    display: flex;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.theme-category {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 220px;
    height: 60px;
    padding: 8px 12px 10px;
    margin: 0;
    border: none;
    border-radius: 99em;
    background-color: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px         rgba(255, 255, 255, 0.10),
        inset 1.8px 3px 0 -2px  rgba(255, 255, 255, 0.90),
        inset -2px -2px 0 -2px  rgba(255, 255, 255, 0.80),
        inset -3px -8px 1px -6px rgba(255, 255, 255, 0.60),
        inset -0.3px -1px 4px 0 rgba(0, 0, 0, 0.12),
        inset -1.5px 2.5px 0 -2px rgba(0, 0, 0, 0.20),
        inset 0 3px 4px -2px    rgba(0, 0, 0, 0.20),
        inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.10),
        0 1px 5px 0             rgba(0, 0, 0, 0.10),
        0 6px 16px 0            rgba(0, 0, 0, 0.08);
    transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1), box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
}

.theme-category__legend {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; border: 0; padding: 0;
    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.theme-category__input {
    clip: rect(0 0 0 0);
    clip-path: inset(100%);
    height: 1px; width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

.theme-category__option {
    color: rgba(34, 34, 68, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    height: 100%;
    border-radius: 99em;
    cursor: pointer;
    transition: color 160ms, transform 160ms;
    -webkit-tap-highlight-color: transparent;
}

.theme-category__option:has(input:checked) {
    color: rgba(28, 28, 30, 0.85);
    cursor: default;
}

.theme-category__icon {
    display: block;
    width: 26px;
    height: 26px;
    transition: scale 200ms cubic-bezier(0.5, 0, 0, 1);
}

.theme-category__option:hover .theme-category__icon         { scale: 1.15; }
.theme-category__option:has(input:checked) .theme-category__icon { scale: 1; }

/* Nudge moon 5px left, sun 5px right */
.theme-category__option:has(input[c-option="1"]) .theme-category__icon { translate: -5px 0; }
.theme-category__option:has(input[c-option="2"]) .theme-category__icon { translate: 5px 0; }

/* ── Sliding pill indicator ── */
.theme-category::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    display: block;
    width: 102px;
    height: calc(100% - 8px);
    border-radius: 99em;
    background-color: rgba(187, 187, 188, 0.36);
    z-index: -1;
    box-shadow:
        inset 0 0 0 1px         rgba(255, 255, 255, 0.10),
        inset 2px 1px 0 -1px    rgba(255, 255, 255, 0.90),
        inset -1.5px -1px 0 -1px rgba(255, 255, 255, 0.80),
        inset -2px -6px 1px -5px rgba(255, 255, 255, 0.60),
        inset -1px 2px 3px -1px rgba(0, 0, 0, 0.20),
        inset 0 -4px 1px -2px   rgba(0, 0, 0, 0.10),
        0 3px 6px 0             rgba(0, 0, 0, 0.08);
}

/* Pill at option 1 (moon / dark) */
.theme-category:has(input[c-option="1"]:checked)::after {
    translate: 0 0;
    transition:
        background-color 400ms cubic-bezier(1, 0, 0.4, 1),
        box-shadow       400ms cubic-bezier(1, 0, 0.4, 1),
        translate        400ms cubic-bezier(1, 0, 0.4, 1);
    animation: themeCatToggle1 440ms ease;
}

/* Pill at option 2 (sun / light) — left=4+110=114, right=114+102=216, 4px from wall */
.theme-category:has(input[c-option="2"]:checked)::after {
    translate: 110px 0;
    transition:
        background-color 400ms cubic-bezier(1, 0, 0.4, 1),
        box-shadow       400ms cubic-bezier(1, 0, 0.4, 1),
        translate        400ms cubic-bezier(1, 0, 0.4, 1);
    animation: themeCatToggle2 440ms ease;
}

.theme-category[c-previous="1"]:has(input[c-option="2"]:checked)::after { transform-origin: left; }
.theme-category[c-previous="2"]:has(input[c-option="1"]:checked)::after { transform-origin: right; }

@keyframes themeCatToggle1 {
    0%   { scale: 1 1; }
    50%  { scale: 1.12 1; }
    100% { scale: 1 1; }
}

@keyframes themeCatToggle2 {
    0%   { scale: 1 1; }
    50%  { scale: 1.12 1; }
    100% { scale: 1 1; }
}

/* ── Phone size card ─────────────────────────────────── */
.appearance-size-card {
    width: calc(100% - 56px);
    padding: 16px 18px 14px 18px;
    border-radius: 18px;
    flex-shrink: 0;
    background: rgba(187, 187, 188, 0.18);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.45),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.75),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.30),
        0 2px 10px 0           rgba(0, 0, 0, 0.07);
}

.appearance-size-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.appearance-size-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.78);
}

.appearance-size-value {
    font-size: 14px;
    font-weight: 700;
    color: #007AFF;
}

/* ── Slider ──────────────────────────────────────────── */
.appearance-slider-wrap {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

/* Track background (glass) */
.appearance-slider-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    height: 6px;
    border-radius: 99em;
    background: rgba(187, 187, 188, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.14),
        inset 1px 1px 0 -1px   rgba(255, 255, 255, 0.50),
        inset 0 -1px 0 0       rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

/* Progress fill */
.appearance-slider-fill {
    position: absolute;
    left: 0;
    height: 6px;
    border-radius: 99em;
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.85) 0%, #007AFF 100%);
    box-shadow: 0 0 8px 0 rgba(0, 122, 255, 0.35);
    pointer-events: none;
    transition: width 30ms linear;
    z-index: 1;
}

/* Native range input */
.appearance-slider-field {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.appearance-slider-field::-webkit-slider-runnable-track {
    background: transparent;
}

.appearance-slider-field::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    border-radius: 99em;
    background: #ffffff;
    box-shadow:
        0 2px 8px 0  rgba(0, 0, 0, 0.18),
        0 1px 3px 0  rgba(0, 0, 0, 0.12);
    transition: background 120ms, box-shadow 120ms, scale 150ms;
}

/* While dragging → liquid glass */
.appearance-slider-field:active::-webkit-slider-thumb {
    background: rgba(200, 200, 210, 0.28);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.30),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.80),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.50),
        0 4px 14px 0           rgba(0, 0, 0, 0.18),
        0 1px 4px 0            rgba(0, 0, 0, 0.10);
    scale: 1.06;
}

/* ── Footer / Continue button ────────────────────────── */
.appearance-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-top: auto;
    padding: 16px 28px 36px 28px;
}

.appearance-continue-btn {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #007AFF;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.appearance-continue-btn:hover {
    background: #0064D6;
}

.appearance-continue-btn:active {
    transform: scale(0.975);
    box-shadow: 0 2px 8px 0 rgba(0, 122, 255, 0.28);
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* ═══════════════════════════════════════════════════════════
   SETUP FLOW: INTRO SCREEN, LANGUAGE SCREEN, BACK BUTTON
═══════════════════════════════════════════════════════════ */

/* Intro Screen: show wallpaper behind the Hello animation */
.setup-screen.setup-intro {
    background: transparent;
    padding: 0;
}

/* White text so Hello is visible on any wallpaper (already set on .hello__text) */

.hello__canvas {
    display: block;
    /* Width/height set dynamically by _drawHelloGlass() */
}

/* Slightly larger Hello on full-screen intro */
.setup-screen.setup-intro .hello__div {
    max-width: none;
}

/* Swipe hint inside intro screen — reuses .swipe-hint class positioning */
.setup-screen.setup-intro #setup-swipe-hint {
    bottom: 22px;
}

/* Home indicator inside intro screen — reuses .home-indicator class */
.setup-screen.setup-intro #setup-home-indicator {
    bottom: 5px;
    background: rgba(255, 255, 255, 0.4);
}

.setup-screen.setup-intro #setup-home-indicator:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* Back button for registration screens */
.setup-back-btn {
    position: absolute;
    top: 38px;
    left: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.18s ease, background-color 0.18s ease;
    background-color: rgba(187, 187, 188, 0.16);
    backdrop-filter: blur(2px);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.14),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.60),
        0 3px 8px 0            rgb(0 0 0 / 15%);
    /* chevron */
    color: rgba(34, 34, 68, 0.60);
    font-weight: 700;
    line-height: 1;
}

.back-chevron {
    font-size: 27px;
    position: relative;
    top: -2px;
    line-height: 1;
    left: -1px;
}

.setup-back-btn:hover {
    background-color: rgba(187, 187, 188, 0.26);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.18),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.70),
        0 3px 12px 0           rgba(0, 0, 0, 0.12);
}

.setup-back-btn:active {
    background-color: rgba(187, 187, 188, 0.10);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.10),
        0 1px 4px 0            rgba(0, 0, 0, 0.06);
    transform: scale(0.93);
}

/* Setup-mode: hide status-bar controls */
.phone-frame.setup-mode #statusbar-carrier,
.phone-frame.setup-mode .brightness-control-btn {
    visibility: hidden;
    pointer-events: none;
}

/* Setup-mode: signal bars — alle gleich hoch, gleichmäßig ausgerichtet */
.phone-frame.setup-mode .signal-bars .bar:nth-child(1),
.phone-frame.setup-mode .signal-bars .bar:nth-child(2),
.phone-frame.setup-mode .signal-bars .bar:nth-child(3),
.phone-frame.setup-mode .signal-bars .bar:nth-child(4) {
    height: 3px !important;
    margin-top: 3px !important;
}

/* ═══════════════════════════════════════════════════════════
   iOS 26 LIQUID GLASS — Setup Swipe Transition
   Intro screen slides up as a card, language screen below.
   NOTE: rgba() used instead of color-mix() — CEF compatibility.
═══════════════════════════════════════════════════════════ */

/* Intro screen: rounded bottom matches phone-frame border-radius when dragged */
#setup-screen {
    z-index: 1202;
    will-change: transform;
    border-radius: 45px;
    overflow: hidden;
    /* Background is mirrored from phone-frame wallpaper inline by JS */
}

/* Liquid glass bottom edge — only visible while actively dragging */
#setup-screen.is-swiping::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 110px;
    pointer-events: none;
    border-radius: 0 0 45px 45px;
    /* Frosted gradient rising from the bottom edge */
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.07) 55%,
        transparent 100%
    );
    /* Glass border highlight on the bottom edge */
    box-shadow:
        inset 0 -2px 0 0 rgba(255, 255, 255, 0.32),
        inset  1px 0 0 0 rgba(255, 255, 255, 0.10),
        inset -1px 0 0 0 rgba(255, 255, 255, 0.10);
}

/* ── Language screen: light frosted glass ───────────────── */
#language-screen {
    z-index: 1200;
    background: #f1f1f1;
    will-change: transform, opacity;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

/* Back button: dark chevron on light bg (language/theme screen) */
#language-screen .setup-back-btn,
.theme-screen .setup-back-btn {
    color: rgba(28, 28, 30, 0.65);
    background-color: rgba(120, 120, 128, 0.12);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.18),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.55),
        0 2px 8px 0            rgba(0, 0, 0, 0.06);
}

#language-screen .setup-back-btn:hover,
.theme-screen .setup-back-btn:hover {
    background-color: rgba(120, 120, 128, 0.20);
}

/* ═══════════════════════════════════════════════════════════
   FACE LOCK SETUP SCREEN — Page 3
═══════════════════════════════════════════════════════════ */

/* Title / subtitle reuse .size-title / .size-subtitle styles — no overrides needed */
.facelock-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1c1c1e;
    line-height: 1.15;
    margin-top: 25px;
}

.facelock-subtitle {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.60);
    margin: 0;
    line-height: 1.45;
}

/* Stage — center the island animation */
.facelock-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 0 8px 0;
}

/* The animated pill — mimics dynamic island but 3× bigger */
.facelock-island {
    width: 148px;
    height: 148px;
    background: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;          /* clip mugshot to circle */
    transition: all 0.30s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.facelock-island-content {
    width: 148px;
    height: 148px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Face outlines + corners icon ── */
.facelock-wrapper {
    width: 148px;
    height: 148px;
    position: relative;
    flex-shrink: 0;
}

.facelock-face-default {
    position: absolute;
    top: 10%; left: 10%;
    width: 80%; height: 80%;
    display: block;
    object-fit: contain;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* When a real mugshot is loaded: zoom in so face fills the circle */
.facelock-wrapper.has-mugshot .facelock-face-default {
    top: -15%; left: -15%;
    width: 130%; height: 130%;
    object-fit: cover;
    object-position: center 15%;
}

/* When scanning starts, fade out the default face icon (placeholder only) */
.facelock-wrapper.scanning .facelock-face-default {
    opacity: 0;
    transform: scale(1.15);
}

/* When a real mugshot is loaded, keep it fully visible during the entire scan */
.facelock-wrapper.has-mugshot .facelock-face-default,
.facelock-wrapper.has-mugshot.scanning .facelock-face-default,
.facelock-wrapper.has-mugshot.completed .facelock-face-default {
    opacity: 1 !important;
}

/* ── Spinning circles ── */
.facelock-circle {
    border-radius: 50%;
    width: 148px;
    height: 148px;
    box-sizing: border-box;
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
}

.facelock-wrapper.scanning .facelock-circle {
    opacity: 1;
    transition: opacity 0.5s ease;
    /* transform is handled by keyframe animations below — no transform transition */
}

.facelock-circle.green  { border: 2.5px solid #88ef88; }
.facelock-circle.blue   { border: 2.5px solid #0aaaf7; }
.facelock-circle.purple { border: 2.5px solid #ea54ea; }

/* 2 full rotations each, 1.75 s per loop = 3.5 s total */
@keyframes fl-spin-x {
    from { transform: rotateX(0deg); }
    to   { transform: rotateX(360deg); }
}
@keyframes fl-spin-y {
    from { transform: rotateY(0deg); }
    to   { transform: rotateY(360deg); }
}
@keyframes fl-spin-xy {
    from { transform: rotateY(0deg)   rotateX(0deg); }
    to   { transform: rotateY(360deg) rotateX(360deg); }
}

.facelock-wrapper.scanning .facelock-circle.green  { animation: fl-spin-x  1.75s ease 2; }
.facelock-wrapper.scanning .facelock-circle.blue   { animation: fl-spin-y  1.75s ease 2; }
.facelock-wrapper.scanning .facelock-circle.purple { animation: fl-spin-xy 1.75s ease 2; }

/* Completed: all circles turn white */
.facelock-wrapper.completed .facelock-circle.purple {
    border: 2.5px solid #ffffff;
    transition: border 0.25s ease;
}

/* ── Tick SVG ── */
.facelock-tick-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.facelock-path-tick {
    opacity: 0;
}

.facelock-wrapper.completed .facelock-path-tick {
    stroke-dasharray: 80;
    stroke-dashoffset: 0;
    animation: fl-dash 0.35s linear forwards;
    stroke-opacity: 1;
    opacity: 1;
}

@keyframes fl-dash {
    0%   { stroke-dashoffset: 80; stroke-opacity: 1; }
    60%  { stroke-dashoffset: 80; }
    100% { stroke-dashoffset: 0;  stroke-opacity: 1; }
}

/* Status text below the island */
.facelock-status {
    font-size: 14px;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.65);
    text-align: center;
    min-height: 20px;
    transition: opacity 0.25s ease;
}

/* ── Footer ── */
.facelock-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 28px 36px 28px;
    width: 100%;
    box-sizing: border-box;
}

/* Skip button — liquid glass pill, same size as continue button */
.facelock-skip-btn {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.85);
    background: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(2px);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.14),
        inset 1px 2px 0 -1px rgb(255 255 255 / 24%),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.50),
        inset 0 -1px 4px 0     rgba(0, 0, 0, 0.10),
        0 2px 8px 0            rgba(0, 0, 0, 0.10),
        0 6px 20px 0           rgba(0, 0, 0, 0.06);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.facelock-skip-btn:active {
    transform: scale(0.975);
    background: rgba(187, 187, 188, 0.22);
    box-shadow:
        inset 0 0 0 1px   rgba(255, 255, 255, 0.10),
        inset 0 2px 6px 0 rgba(0, 0, 0, 0.14),
        0 1px 4px 0       rgba(0, 0, 0, 0.06);
}

/* ═══════════════════════════════════════════════════════════
   FACELOCK BUTTON — Loading Spinner (white)
═══════════════════════════════════════════════════════════ */

.facelock-btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
}

@keyframes sbf-spinner-rotate {
    to { transform: rotate(360deg); }
}

.facelock-spinner-ring {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border-style: solid;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.90) rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.25);
    animation: sbf-spinner-rotate 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   SBF ID SCREEN — Page 4
═══════════════════════════════════════════════════════════ */

.sbfid-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1c1c1e;
    line-height: 1.15;
    margin-top: 25px;
}

.sbfid-desc {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.60);
    margin: 0;
    line-height: 1.45;
}

.sbfid-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: calc(100% - 56px);
    margin: auto;
}

.sbfid-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group__label,
.datepicker-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(28, 28, 30, 0.55);
    padding-left: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.input-group__wrapper {
    width: 100%;
}

/* Liquid glass input field */
.input-field {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #1c1c1e;
    background: rgba(187, 187, 188, 0.18);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.45),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.70),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.30),
        0 2px 6px 0            rgba(0, 0, 0, 0.06);
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.input-field::placeholder {
    color: rgba(60, 60, 67, 0.40);
    font-weight: 400;
}

.input-field:focus {
    box-shadow:
        inset 0 0 0 1.5px      rgba(255, 255, 255, 0.65),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.80),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.40),
        0 0 0 2px               rgba(255, 255, 255, 0.30),
        0 2px 8px 0            rgba(0, 0, 0, 0.08);
}

@keyframes inputErrorFlash {
    0%   { box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.85); }
    60%  { box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.85); }
    100% { box-shadow: 0 0 0 0px rgba(255, 59, 48, 0.00); }
}

.input-field.input-error,
.datepicker-input.input-error {
    animation: inputErrorFlash 0.9s ease forwards;
}

/* Datepicker */
.datepicker-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.datepicker-field {
    position: relative;
    width: 100%;
}

.datepicker-input {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #1c1c1e;
    background: rgba(187, 187, 188, 0.18);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px        rgba(255, 255, 255, 0.45),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.70),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.30),
        0 2px 6px 0            rgba(0, 0, 0, 0.06);
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.datepicker-input:focus {
    box-shadow:
        inset 0 0 0 1.5px      rgba(255, 255, 255, 0.65),
        inset 1px 2px 0 -1px   rgba(255, 255, 255, 0.80),
        inset -1px -1px 0 -1px rgba(255, 255, 255, 0.40),
        0 0 0 2px               rgba(255, 255, 255, 0.30),
        0 2px 8px 0            rgba(0, 0, 0, 0.08);
}

.datepicker-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(60, 60, 67, 0.45);
    pointer-events: none;
}

.datepicker-input::-webkit-calendar-picker-indicator {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   ACTION BUTTON SCREEN — Page 5
═══════════════════════════════════════════════════════════ */

/* Screen container — fullscreen, no padding override */
.actionbtn-screen {
    overflow: hidden;
}

/* Fullscreen background image */
.actionbtn-bg {
    position: absolute;
    inset: 0;
    background-image: url('../../assets/img/action1.png');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* Dark gradient overlay so the bottom card is readable */
.actionbtn-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 45%,
        rgba(0,0,0,0.72) 100%
    );
}

/* Bottom card with title + buttons */
.actionbtn-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 28px 16px 28px;
    box-sizing: border-box;
}

/* "Action Button" label above the blue button */
.actionbtn-title-text {
    font-size: 18px;
    font-weight: 700;
    color: #fba907; 
    text-align: center;
    margin: 0 0 2px 0;
    text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

/* Customize button — reuses appearance-continue-btn (already blue) */
.actionbtn-customize-btn {
    width: 100%;
}

/* Skip button — white text override for dark action button screen */
.actionbtn-skip-btn {
    color: rgba(255, 255, 255, 0.9);
}

/* Styles moved to ui/src/actionbtn-customize.css */

/* ═══════════════════════════════════════════════════════════
   WELCOME SCREEN — shown after setup completion
   Identical visual style to the Hello intro screen.
   Uses the same wallpaper backdrop and Borel liquid-glass text.
═══════════════════════════════════════════════════════════ */

/* Welcome screen sits on top of the already-prepared lock screen */
#welcome-screen {
    z-index: 1202;
    will-change: transform;
    border-radius: 45px;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    /* Wallpaper injected inline by JS — same as hello screen */
}

/* Centre the canvas vertically, leave room for button at bottom */
.setup-welcome .hello__div {
    max-width: none;
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer area holding the Get Started button */
.welcome-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px 38px 28px;
    box-sizing: border-box;
}

/* Get Started button — matches homescreen dock liquid glass style */
.welcome-getstarted-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background-color: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(2px);
    box-shadow:
        inset 0 0 0 1px           rgba(255, 255, 255, 0.12),
        inset 1.8px 2px 0 -2px    rgba(255, 255, 255, 0.45),
        inset -2px -2px 0 -2px    rgba(255, 255, 255, 0.16),
        inset -3px -8px 1px -6px  rgba(255, 255, 255, 0.12),
        inset -0.3px -1px 4px 0   rgba(0, 0, 0, 0.12),
        inset -1.5px 2.5px 0 -2px rgba(0, 0, 0, 0.20),
        inset 0 3px 4px -2px      rgba(0, 0, 0, 0.20),
        inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.10),
        0 1px 5px 0               rgba(0, 0, 0, 0.10),
        0 6px 16px 0              rgba(0, 0, 0, 0.08);
    transition: background-color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.welcome-getstarted-btn:hover {
    background-color: rgba(210, 210, 212, 0.20);
}

.welcome-getstarted-btn:active {
    transform: scale(0.975);
    background-color: rgba(160, 160, 162, 0.10);
}
