/* SayGames Event - Style */
:root {
    --primary: #1DB954;
    --primary-dark: #1A472A;
    --primary-light: #2ECC71;
    --accent: #FFD93D;
    --bg: #1DB954;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --orange-500: #f97316;
    --orange-100: #ffedd5;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 20px 50px rgba(0,0,0,0.15);
    --shadow-soft: 0 1px 2px rgba(15,47,26,0.04), 0 4px 12px rgba(15,47,26,0.06), 0 24px 60px -16px rgba(15,47,26,0.18);
    --shadow-hover: 0 1px 2px rgba(15,47,26,0.05), 0 8px 20px rgba(15,47,26,0.08), 0 36px 80px -16px rgba(15,47,26,0.25);
    --ring-primary: 0 0 0 4px rgba(29,185,84,0.14), 0 0 0 1px rgba(29,185,84,0.5);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    -webkit-overflow-scrolling: touch;
}

[x-cloak] { display: none !important; }

/* Gradient Background */
.gradient-bg {
    background: radial-gradient(circle at 50% 30%, #25D366 0%, #1DB954 50%, #15803D 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
}

/* Ambient floating blobs (decorative, behind everything) */
.gradient-bg::before,
.gradient-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.gradient-bg::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #2ECC71 0%, transparent 70%);
    top: -120px;
    left: -120px;
    animation: blobDriftA 16s ease-in-out infinite;
}

.gradient-bg::after {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #FFD93D 0%, transparent 70%);
    bottom: -180px;
    right: -160px;
    opacity: 0.18;
    animation: blobDriftB 22s ease-in-out infinite;
}

@keyframes blobDriftA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.08); }
}

@keyframes blobDriftB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -30px) scale(1.05); }
}

.gradient-bg > * {
    position: relative;
    z-index: 1;
}

/* ============ Drifting decorative rockets ============ */
.bg-rockets {
    position: absolute !important;
    inset: 0;
    z-index: 0 !important;
    pointer-events: none;
    overflow: hidden;
}

.bg-rocket {
    position: absolute;
    will-change: transform;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.08));
}

.bg-rocket svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Five rockets — different sizes, lanes, speeds and directions. */
.bg-rocket-0 { width: 56px; top: 12%;  left: -8%; animation: rocketAcrossR 28s linear infinite; }
.bg-rocket-1 { width: 42px; top: 38%;  left: 110%; animation: rocketAcrossL 36s linear infinite; animation-delay: -9s; }
.bg-rocket-2 { width: 64px; top: 60%;  left: -10%; animation: rocketAcrossR 24s linear infinite; animation-delay: -14s; }
.bg-rocket-3 { width: 38px; top: 78%;  left: 110%; animation: rocketAcrossL 32s linear infinite; animation-delay: -4s; }
.bg-rocket-4 { width: 48px; top: 26%;  left: 110%; animation: rocketAcrossL 40s linear infinite; animation-delay: -22s; }

/* Right-bound rockets: enter from left, exit right, tilted ~75° clockwise */
@keyframes rocketAcrossR {
    from { transform: translate(0, 0) rotate(82deg); }
    to   { transform: translate(calc(100vw + 200px), -40px) rotate(82deg); }
}

/* Left-bound rockets: enter from right, exit left, mirrored */
@keyframes rocketAcrossL {
    from { transform: translate(0, 0) rotate(-82deg); }
    to   { transform: translate(calc(-100vw - 200px), 30px) rotate(-82deg); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-rocket { animation: none !important; opacity: 0; }
}

@media (max-width: 640px) {
    /* Slightly smaller and fewer visible on phones */
    .bg-rocket-0, .bg-rocket-2 { width: 42px; }
    .bg-rocket-3, .bg-rocket-4 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-bg::before,
    .gradient-bg::after {
        animation: none;
    }
}

/* Container */
.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Typography */
h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
.text-white { color: var(--white); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }

/* Spacing */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-4 { margin-left: 1rem; }
.p-6 { padding: 1.5rem; }
.py-8 {
    padding-top: calc(2rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Flex & Grid */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Progress Bar */
.progress-container {
    background: rgba(255,255,255,0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 20px 24px;
}

@supports not (backdrop-filter: blur(10px)) {
    .progress-container {
        background: rgba(255,255,255,0.25);
    }
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--white) 0%, var(--accent) 50%, var(--white) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.5s var(--ease-out);
    animation: progressShimmer 2.4s linear infinite;
    box-shadow: 0 0 12px rgba(255,217,61,0.5);
}

@keyframes progressShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .progress-fill { animation: none; background: var(--white); }
}

.progress-steps {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start;
    gap: 8px;
}

.progress-step {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    flex: 1;
    min-width: 0;
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-dot {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700;
    color: var(--white);
    font-size: 0.875rem;
    transition: all 0.3s;
}

.progress-step.active .step-dot {
    background: var(--white);
    color: var(--primary);
    transform: scale(1.1);
}

.progress-step.completed .step-dot {
    background: var(--accent);
    color: var(--primary-dark);
}

.step-label {
    font-size: 0.75rem;
    color: var(--white);
    font-weight: 500;
    text-align: center;
}

@media (max-width: 480px) {
    .step-label { display: none; }
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.nav-buttons .btn {
    flex: 1;
    max-width: 200px;
}

@media (max-width: 480px) {
    .nav-buttons { flex-direction: column; }
    .nav-buttons .btn { max-width: 100%; }
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    animation: shake 0.5s ease, fadeIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
    position: relative;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring-primary), 0 8px 30px rgba(26,71,42,0.4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #15803D 100%);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(26,71,42,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(26,71,42,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26,71,42,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 14px rgba(26,71,42,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border: 1.5px solid rgba(255,255,255,0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.55);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px dashed var(--gray-300);
    color: var(--gray-500);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    width: 100%;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--red-500);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    -webkit-appearance: none;
}

.btn-icon:hover {
    background: rgba(239,68,68,0.1);
}

.btn-block { width: 100%; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
    animation: cardIn 0.5s var(--ease-out) both;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h2 {
    margin: 0;
    letter-spacing: -0.01em;
}

.card-header::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 60%, var(--accent) 130%);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(29,185,84,0.3);
}

/* Form Elements */
.form-group { margin-bottom: 20px; }

.label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.required {
    color: #dc2626;
    font-weight: 700;
    margin-left: 3px;
}

.input, .textarea, .select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
    background: var(--white);
    color: var(--gray-900);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input::placeholder, .textarea::placeholder {
    color: var(--gray-400);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.input:hover:not(:focus):not(.input-error):not(.input-expired):not(.input-warning),
.textarea:hover:not(:focus) {
    border-color: var(--gray-300);
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring-primary);
}

.input:focus::placeholder, .textarea:focus::placeholder {
    opacity: 0.4;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

/* Telegram input */
.telegram-input {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.telegram-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 600;
    color: var(--gray-500);
    font-size: 1rem;
    min-height: 50px;
}

.telegram-field {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    flex: 1;
}

/* Date input */
input[type="date"] {
    position: relative;
    -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

/* Document expiry states */
.input-expired {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.input-expired:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.3) !important;
}

.input-warning {
    border-color: #ea580c !important;
    background-color: #fff7ed !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2) !important;
}

.input-warning:focus {
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.3) !important;
}

/* Expiry warnings */
.expiry-warning {
    display: block !important;
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #c2410c;
    border: 2px solid #fb923c;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulseWarning 2s ease-in-out infinite;
}

.expiry-error {
    display: block !important;
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
    border: 2px solid #f87171;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulseError 1.5s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.4);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 6px rgba(251, 146, 60, 0);
    }
}

@keyframes pulseError {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 6px rgba(248, 113, 113, 0);
    }
}

/* Fieldset */
.fieldset {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 22px 22px 18px;
    margin: 24px 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, rgba(249,250,251,0.5) 100%);
    transition: border-color 0.25s ease;
}

.fieldset:hover {
    border-color: var(--gray-200);
}

.fieldset legend {
    font-weight: 700;
    color: var(--gray-700);
    padding: 4px 12px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--white);
    border-radius: 999px;
    border: 1px solid var(--gray-100);
}

/* Radio & Checkbox */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
    background: var(--white);
    -webkit-tap-highlight-color: transparent;
}

.option:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(29,185,84,0.08);
}

.option:active {
    transform: translateY(0);
}

.option.selected {
    box-shadow: 0 4px 16px rgba(29,185,84,0.15);
}

.option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    position: relative;
}

.option input[type="radio"] {
    border-radius: 50%;
}

.option input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.option input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option.selected {
    border-color: var(--primary);
    background: rgba(29,185,84,0.08);
}

.option.selected span {
    color: var(--primary);
    font-weight: 600;
}

/* Consent checkbox */
.consent-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-100);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.consent-label:hover {
    border-color: var(--primary);
}

.consent-label.error {
    border-color: var(--red-500);
    background: var(--red-100);
    animation: shake 0.5s ease;
}

.consent-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 2px;
    accent-color: var(--primary);
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    position: relative;
}

.consent-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.consent-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.consent-label span {
    font-weight: 500;
    color: var(--gray-700);
    line-height: 1.4;
}

.consent-text {
    margin-top: 12px;
    padding-left: 34px;
    font-size: 0.813rem;
    color: var(--gray-500);
    line-height: 1.5;
}

/* File Upload */
.file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1.75px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.25s ease, transform 0.25s var(--ease-out);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    background: var(--gray-50);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(29,185,84,0.04);
    transform: translateY(-1px);
}

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
}

.file-upload .icon { color: var(--gray-400); }
.file-upload .text { color: var(--gray-500); word-break: break-all; }

.file-upload.has-file {
    border-color: var(--primary);
    background: rgba(29,185,84,0.08);
    border-style: solid;
}

.file-upload.has-file .icon,
.file-upload.has-file .text {
    color: var(--primary);
}

/* Person Card (children) */
.person-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin-bottom: 16px;
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

/* Conditional Fields */
.conditional {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--gray-200);
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

/* Alpine collapse transition */
[x-collapse] {
    overflow: hidden;
}

[x-collapse].x-collapse-enter-active,
[x-collapse].x-collapse-leave-active {
    transition: height 0.3s ease, opacity 0.3s ease;
}

/* User Badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
}

.user-badge img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-badge span {
    color: var(--white);
    font-weight: 500;
}

/* Landing */
.landing {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.logo {
    margin-bottom: 24px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.logo svg {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.2));
}

.brand {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    -webkit-font-smoothing: antialiased;
}

.brand span { color: var(--accent); }

/* Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
    -webkit-transform: translateZ(0);
    will-change: transform;
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner.small {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* Success */
.success-icon {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    margin-bottom: 32px;
}

/* Transitions */
[x-transition] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Safari-specific */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .input, .textarea, .select {
        font-size: 16px;
    }

    input[type="date"] {
        min-height: 48px;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .card { padding: 24px 20px; }
    .brand {
        font-size: 2rem;
        margin-bottom: 10px;
        letter-spacing: 2px;
    }
    h1 { font-size: 1.75rem; }
    .option-group { flex-direction: column; }
    .option { width: 100%; }
    .logo svg { width: 100px; }
    .logo { margin-bottom: 12px; }

    /* Tighter landing layout so everything fits in a phone viewport */
    .landing {
        padding: 16px 16px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        min-height: 100dvh;
        justify-content: flex-start;
    }
    .user-badge {
        padding: 6px 14px;
        gap: 8px;
    }
    .user-badge img {
        width: 28px;
        height: 28px;
    }
    .landing .user-badge.mb-6 { margin-bottom: 12px; }
    .landing .mt-6 { margin-top: 14px; }

    .input, .textarea, .select {
        font-size: 16px;
    }
}

/* Print styles */
@media print {
    .gradient-bg {
        background: white;
    }
    .btn, .nav-buttons {
        display: none;
    }
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    display: flex;
    gap: 2px;
    z-index: 1000;
    background: rgba(255,255,255,0.14);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(15,47,26,0.15);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 6px 12px;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-out);
    line-height: 1.2;
}

.lang-btn:hover {
    color: var(--white);
    background: rgba(255,255,255,0.12);
}

.lang-btn.active {
    background: var(--white);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.lang-btn.active:hover {
    background: var(--white);
}

@media (max-width: 640px) {
    .lang-switcher { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; padding: 3px; }
    .lang-btn { min-width: 32px; padding: 5px 10px; font-size: 0.7rem; }
}

