/* ============================================
   ID Verification - Dark Theme Styles
   Inspired by escortify.com.au
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --accent-primary: #a855f7;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2d2d3a;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Overlay */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Logo Icon */
.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
}

/* Step Indicators */
.step-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.3s ease;
}

.step-indicator.active .step-dot {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.step-indicator.completed .step-dot {
    background: var(--success-color);
    border-color: transparent;
    color: white;
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-indicator.active .step-label {
    color: var(--accent-primary);
}

.step-indicator.completed .step-label {
    color: var(--success-color);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin-bottom: 20px;
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Progress Bar */
.progress-container {
    height: 4px;
    background: var(--bg-secondary);
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Card Content */
.card-content {
    padding: 24px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.tab-btn {
    padding: 16px 24px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Form Layout */
.validate-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.validate-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.validate-form-field {
    margin: 0;
}

.validate-form-field--full {
    grid-column: 1 / -1;
}

.validate-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    height: 48px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Password Form */
.password-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.password-form .form-group {
    margin-bottom: 24px;
}

.password-form .btn-primary {
    width: 100%;
    margin-top: 8px;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .validate-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .validate-form-field--full {
        grid-column: 1 / -1;
    }
}

/* Select Dropdown Styling */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' 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: 16px;
    padding-right: 44px;
    cursor: pointer;
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

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

/* Form Validation */
.form-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

.form-input.error {
    border-color: var(--error-color);
}

.form-input.success {
    border-color: var(--success-color);
}

select.form-input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

input.form-input[type="date"],
input.form-input[type="time"] {
    color-scheme: dark;
}

/* Icon Circle */
.icon-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    border: 2px solid rgba(168, 85, 247, 0.3);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.05);
}

.upload-area:active {
    transform: scale(0.98);
}

.upload-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.upload-text {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* Selfie Area */
.selfie-area .upload-icon {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

/* Preview Container */
.preview-container {
    margin-top: 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--success-color);
    font-size: 14px;
    font-weight: 500;
}

.preview-image {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.selfie-preview {
    max-height: 180px;
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    border: 3px solid var(--accent-primary);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(168, 85, 247, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Loading Spinner */
.loading-spinner {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent-primary);
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    border-right-color: var(--accent-secondary);
    animation: spin 1.2s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    border-bottom-color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

.spinner-icon {
    font-size: 24px;
    color: var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

/* Loading Progress */
.loading-progress-container {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Verification Steps */
.verification-steps {
    text-align: left;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.verification-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.verification-step i {
    color: var(--accent-primary);
}

/* Success Icon */
.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-color);
    font-size: 32px;
    border: 3px solid var(--success-color);
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Success Details */
.success-details {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.success-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.success-item:last-child {
    border-bottom: none;
}

.success-item i {
    font-size: 16px;
}

/* Step Transitions */
.step {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.step.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.step.hidden {
    display: none;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
}

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

.toast-notification span {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.toast-success i { color: var(--success-color); }
.toast-error i { color: var(--error-color); }
.toast-info i { color: var(--accent-primary); }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus States */
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .card-content {
        padding: 20px 16px;
    }
    
    .step-indicators {
        gap: 4px;
    }
    
    .step-dot {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .step-line {
        width: 24px;
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
    }
    
    .upload-area {
        padding: 24px 16px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 80px;
        height: 80px;
    }
    
    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
}

@media (max-width: 360px) {
    .step-line {
        width: 16px;
    }
    
    .step-dot {
        width: 32px;
        height: 32px;
    }
}

/* Validation Page Specific Styles */
.main-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.card-content {
    padding: 24px;
}

.validate-form {
    width: 100%;
}

.validate-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.validate-form-field {
    margin-bottom: 0;
}

.validate-form-field--full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-input:focus,
.form-input:active {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.validate-form-actions {
    margin-top: 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

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

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
