* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --success-color: #4CAF50;
    --error-color: #ff6b6b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    color: var(--text-primary);
}

/* Background Setup */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.1);
    animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
    0% {
        transform: scale(1.1) rotate(0deg);
    }
    100% {
        transform: scale(1.2) rotate(2deg);
    }
}

.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-100px) translateX(50px) scale(1.5);
        opacity: 0.6;
    }
}

/* Main Container */
.main-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Glass Panel Effect */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px) rotateX(5deg);
    opacity: 0;
    animation: slideIn 0.6s ease-out forwards;
    position: relative;
    overflow: hidden;
    display: none;
}

.glass-panel.active {
    display: block;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.glass-panel:hover::before {
    left: 100%;
}

@keyframes slideIn {
    to {
        transform: translateY(0) rotateX(0);
        opacity: 1;
    }
}

/* Panel Header */
.panel-header {
    text-align: center;
    margin-bottom: 30px;
}

.panel-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    width: 100%;
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Form Container */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Groups */
.input-group {
    position: relative;
    animation: inputSlide 0.5s ease-out backwards;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.2s; }
.input-group:nth-child(3) { animation-delay: 0.3s; }
.input-group:nth-child(4) { animation-delay: 0.4s; }
.input-group:nth-child(5) { animation-delay: 0.5s; }

@keyframes inputSlide {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 1;
    transition: all 0.3s;
}

.glass-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.glass-input::placeholder {
    color: transparent;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.glass-input:focus + .floating-label {
    color: var(--primary-light);
    transform: translateY(-32px) translateX(-15px) scale(0.75);
    background: linear-gradient(to bottom, transparent 50%, rgba(99, 102, 241, 0.1) 50%);
    padding: 2px 8px;
    left: 45px;
}

.floating-label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    background: transparent;
    border-radius: 4px;
}

.glass-input:not(:placeholder-shown) + .floating-label {
    transform: translateY(-32px) translateX(-15px) scale(0.75);
    color: var(--primary-light);
    background: linear-gradient(to bottom, transparent 50%, rgba(99, 102, 241, 0.1) 50%);
    padding: 2px 8px;
    left: 45px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: buttonPop 0.6s ease-out 0.6s backwards;
}

@keyframes buttonPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button.loading .btn-text {
    display: none;
}

button.loading .btn-loader {
    display: block;
}

/* Error Message */
.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    min-height: 20px;
    text-align: center;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Panel Footer */
.panel-footer {
    margin-top: 25px;
    text-align: center;
}

.panel-footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Camera Container */
.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

#cameraStream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face-outline {
    width: 200px;
    height: 250px;
    border: 3px solid var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.captured-image {
    display: none;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.captured-image.show {
    display: block;
}

.camera-instructions {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Verification Panel */
.success-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
}

.checkmark {
    animation: scaleIn 0.5s ease-out;
}

.checkmark-circle-path {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: drawCircle 1s ease-out 0.3s forwards;
}

.checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.5s ease-out 1s forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.verification-message {
    text-align: center;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.info-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Loading Dots */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .glass-panel {
        padding: 30px 25px;
        max-width: 100%;
        border-radius: 20px;
    }

    .panel-title {
        font-size: 1.6rem;
    }

    .glass-input {
        padding: 14px 14px 14px 45px;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 12px;
    }

    .floating-label {
        left: 45px;
    }

    .btn-primary, .btn-secondary {
        padding: 14px;
        font-size: 0.95rem;
    }

    .face-outline {
        width: 150px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }

    .glass-panel {
        padding: 25px 20px;
    }

    .panel-title {
        font-size: 1.4rem;
    }

    .glass-input {
        padding: 12px 12px 12px 42px;
    }
}

/* 3D Transform Effects */
.glass-panel {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Additional Glow Effects */
.input-group:focus-within .input-icon {
    color: var(--primary-light);
    filter: drop-shadow(0 0 5px var(--primary-light));
}

/* Smooth Transitions */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

