/* ==================== VARIABLES ==================== */
:root {
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-subtle: #dbeafe;
    
    /* Status Colors */
    --success: #22c55e;
    --success-subtle: #dcfce7;
    --warning: #f59e0b;
    --warning-subtle: #fef3c7;
    --danger: #ef4444;
    --danger-subtle: #fee2e2;
    --info: #06b6d4;
    --info-subtle: #cffafe;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* ==================== BASE ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
header {
    background: white !important;
    border-bottom: 1px solid var(--gray-200);
}

header h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== PROGRESS STEPS ==================== */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.step.active .step-circle,
.step.completed .step-circle {
    background: var(--primary);
    color: white;
}

.step.completed .step-circle {
    background: var(--success);
}

.step-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--success);
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.step-line.completed {
    background: var(--success);
}

/* ==================== STEP CONTENT ==================== */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    background: white;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ==================== DATA CARDS ==================== */
.data-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    height: 100%;
}

.data-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.data-value {
    font-size: 1rem;
    color: var(--gray-800);
    font-weight: 500;
    word-break: break-word;
}

/* ==================== FORM INPUTS ==================== */
.form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.input-group-text {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary);
}

.form-label {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-danger {
    border: 2px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn .btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline-flex;
    align-items: center;
}

/* ==================== PHONE SELECTION ==================== */
.phone-option {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.phone-option:hover {
    border-color: var(--primary-light);
    background: var(--primary-subtle);
}

.phone-option.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.phone-option input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: var(--primary);
}

.phone-option .phone-number {
    font-weight: 500;
    color: var(--gray-800);
}

/* ==================== CODE INPUTS ==================== */
.code-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
    outline: none;
}

.code-input.filled {
    border-color: var(--success);
    background: var(--success-subtle);
}

.code-input.error {
    border-color: var(--danger);
    background: var(--danger-subtle);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==================== SUCCESS ANIMATION ==================== */
.success-animation {
    position: relative;
}

.checkmark-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

.checkmark-circle i {
    font-size: 3rem;
    color: white;
    animation: checkmark 0.5s ease 0.3s forwards;
    opacity: 0;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== STATUS CARD ==================== */
.status-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

/* Status Badge Colors */
.badge.status-waiting {
    background: var(--warning) !important;
    color: var(--gray-900) !important;
}

.badge.status-approved {
    background: var(--success) !important;
    color: white !important;
}

.badge.status-analysis {
    background: var(--primary) !important;
    color: white !important;
}

.badge.status-error {
    background: var(--danger) !important;
    color: white !important;
}

/* ==================== IFRAME WRAPPER ==================== */
.iframe-wrapper {
    border: 2px solid var(--gray-200);
    background: white;
}

.iframe-wrapper iframe {
    display: block;
}

/* ==================== TOAST ==================== */
.toast {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
}

.alert-info {
    background: var(--info-subtle);
    color: var(--gray-800);
}

.alert-success {
    background: var(--success-subtle);
    color: var(--gray-800);
}

.alert-danger {
    background: var(--danger-subtle);
    color: var(--gray-800);
}

.alert-warning {
    background: var(--warning-subtle);
    color: var(--gray-800);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .step-label {
        font-size: 0.65rem;
    }
    
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .icon-circle {
        width: 64px;
        height: 64px;
    }
    
    .icon-circle i {
        font-size: 1.75rem !important;
    }
    
    .code-input {
        width: 48px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .checkmark-circle {
        width: 80px;
        height: 80px;
    }
    
    .checkmark-circle i {
        font-size: 2.5rem;
    }
}

/* ==================== UTILITIES ==================== */
.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
}

.bg-success-subtle {
    background-color: var(--success-subtle) !important;
}

.bg-warning-subtle {
    background-color: var(--warning-subtle) !important;
}

.bg-danger-subtle {
    background-color: var(--danger-subtle) !important;
}

.bg-info-subtle {
    background-color: var(--info-subtle) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.rounded-3 {
    border-radius: var(--radius-lg) !important;
}

.rounded-4 {
    border-radius: var(--radius-xl) !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.d-none {
    display: none;
}
