:root {
    --bg: #020816;
    --panel: rgba(7, 17, 31, 0.74);
    --panel-border: rgba(135, 229, 255, 0.24);
    --text: #eef8ff;
    --muted: #9ab7ca;
    --accent: #6ae6ff;
    --accent-strong: #1ac8ff;
    --success: #59ffb4;
    --danger: #ff7b93;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(54, 147, 255, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(26, 200, 255, 0.22), transparent 32%),
        linear-gradient(180deg, #05111f 0%, #020816 100%);
    color: var(--text);
}

button,
input,
textarea,
select {
    font: inherit;
}

.app-shell {
    position: relative;
    min-height: 100vh;
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ambient {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.45;
    pointer-events: none;
}

.ambient-left {
    top: 6%;
    left: -80px;
    background: rgba(41, 125, 255, 0.4);
}

.ambient-right {
    right: -70px;
    bottom: 12%;
    background: rgba(30, 219, 255, 0.36);
}

.validation-card {
    position: relative;
    width: min(100%, 430px);
    padding: 24px 18px 20px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.validation-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 27px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
    pointer-events: none;
}

.validation-card > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
}

h1,
h2 {
    margin: 0;
    font-family: "Syne", sans-serif;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2rem, 7vw, 2.65rem);
    line-height: 0.98;
}

.lead {
    margin: 12px 0 18px;
    font-size: 0.97rem;
    line-height: 1.6;
    color: var(--muted);
}

.status-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(106, 230, 255, 0.08);
    border: 1px solid rgba(106, 230, 255, 0.18);
    color: #d9faff;
    font-size: 0.92rem;
}

.helper-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #c6d9e7;
    font-size: 0.86rem;
    line-height: 1.5;
}

.status-banner.is-error {
    background: rgba(255, 123, 147, 0.1);
    border-color: rgba(255, 123, 147, 0.2);
    color: #ffd6dd;
}

.status-banner.is-success {
    background: rgba(89, 255, 180, 0.1);
    border-color: rgba(89, 255, 180, 0.22);
    color: #cffff0;
}

.camera-stage {
    position: relative;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(4, 15, 26, 0.1), rgba(4, 15, 26, 0.8)),
        #040d18;
    border: 1px solid rgba(120, 220, 255, 0.16);
}

#cameraFeed,
#photoPreview {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    background: #07111f;
}

#photoPreview {
    display: none;
}

.camera-stage.has-preview #cameraFeed,
.camera-stage.has-preview .camera-overlay {
    display: none;
}

.camera-stage.has-preview #photoPreview {
    display: block;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.12) 25%, rgba(0, 0, 0, 0.32) 100%);
    pointer-events: none;
}

.face-guide {
    width: 70%;
    aspect-ratio: 0.76 / 1;
    border-radius: 50% 50% 46% 46% / 44% 44% 56% 56%;
    border: 2px solid rgba(106, 230, 255, 0.85);
    box-shadow:
        0 0 0 999px rgba(1, 9, 18, 0.42),
        0 0 18px rgba(80, 242, 255, 0.52),
        inset 0 0 20px rgba(80, 242, 255, 0.2);
}

.scan-line {
    position: absolute;
    width: 68%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(106, 230, 255, 0.95), transparent);
    box-shadow: 0 0 18px rgba(106, 230, 255, 0.9);
    animation: scan 2.8s linear infinite;
}

.camera-label {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(1, 10, 18, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #edf9ff;
    font-size: 0.88rem;
    text-align: center;
    backdrop-filter: blur(16px);
}

.tips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tips span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d3e4ef;
    font-size: 0.78rem;
    font-weight: 600;
}

.actions {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 56px;
    border-radius: 18px;
    border: 0;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
    color: #03111d;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, #d7fbff 100%);
    box-shadow: 0 18px 36px rgba(44, 201, 255, 0.28);
}

.secondary-button {
    color: var(--text);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-button:active,
.secondary-button:active {
    transform: scale(0.99);
}

.primary-button[disabled],
.secondary-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.success-state {
    margin-top: 18px;
    padding: 24px 18px;
    border-radius: 24px;
    text-align: center;
    background: rgba(89, 255, 180, 0.08);
    border: 1px solid rgba(89, 255, 180, 0.2);
}

.success-state h2 {
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.success-state p {
    margin: 0;
    color: #d6fff0;
    line-height: 1.6;
}

.success-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 35%),
        linear-gradient(135deg, rgba(89, 255, 180, 0.96), rgba(15, 222, 170, 0.72));
    box-shadow: 0 18px 34px rgba(11, 198, 138, 0.28);
    position: relative;
}

.success-icon::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 20px;
    width: 28px;
    height: 16px;
    border-left: 4px solid #042214;
    border-bottom: 4px solid #042214;
    transform: rotate(-45deg);
}

@keyframes scan {
    0% {
        transform: translateY(-120px);
        opacity: 0;
    }
    10%,
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(120px);
        opacity: 0;
    }
}

@media (min-width: 768px) {
    .app-shell {
        padding-left: 24px;
        padding-right: 24px;
    }

    .validation-card {
        padding: 30px 24px 24px;
    }
}
