:root {
    /* Premium Dark Palette */
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --bg-solid: #0d0d12;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --primary: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
    --primary-hover: linear-gradient(90deg, #00e5ff 0%, #4a8be5 100%);
    --success: #00c853;
    --danger: #ff1744;
    --surface: rgba(255, 255, 255, 0.08);
    /* Glassmorphism */
    --surface-border: rgba(255, 255, 255, 0.12);
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-solid);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Add a subtle glow/background effect */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(58, 123, 213, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

#app {
    padding: 24px 20px;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    text-align: center;
    font-size: 15px;
    margin-bottom: 32px;
}

/* Glass Card Style */
.screen {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    padding: 30px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dim);
    padding-left: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select,
input[type="text"] {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--input-bg);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

select:focus,
input[type="text"]:focus {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 4px rgba(58, 123, 213, 0.2);
}

/* Custom dropdown arrow for select */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: none;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(58, 123, 213, 0.3);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 12px 24px rgba(58, 123, 213, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--surface-border);
}

.btn.success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 8px 16px rgba(0, 200, 83, 0.2);
}

.btn.danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 8px 16px rgba(255, 23, 68, 0.2);
}

.btn.link {
    background: none;
    color: #3a7bd5;
    font-size: 15px;
}

/* Camera Section */
.camera-section {
    margin-bottom: 24px;
}

.preview-box {
    width: 100%;
    aspect-ratio: 4/4;
    background: #000;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid var(--surface-border);
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.camera-placeholder {
    text-align: center;
    color: var(--text-dim);
}

.placeholder-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

/* Action Grid */
.action-grid {
    display: flex;
    gap: 16px;
}

.warning-text {
    background: rgba(255, 23, 68, 0.1);
    color: #ff5252;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 24px;
    text-align: center;
    border-left: 4px solid var(--danger);
}

/* Toast Notification - Premium Style */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Animations and Micro-interactions */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(58, 123, 213, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(58, 123, 213, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(58, 123, 213, 0);
    }
}

.btn.primary:not(:disabled) {
    animation: none;
}

/* Full-screen Overlays */
.success-overlay,
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-solid);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.success-overlay h2 {
    background: none;
    -webkit-text-fill-color: #fff;
    margin-top: 10px;
}

.success-overlay p {
    color: var(--text-dim);
    font-size: 16px;
}

.loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 380px) {
    h2 {
        font-size: 24px;
    }

    .screen {
        padding: 24px 16px;
    }
}