/* ===== CSS Variables ===== */
:root {
    --primary-blue: #4A90D9;
    --primary-blue-dark: #3A7BC8;
    --primary-blue-light: #6BA5E7;
    --primary-purple: #7B68B8;
    --primary-purple-dark: #6B5AA8;
    --navy: #1E3A5F;
    --navy-light: #2A4A6F;
    
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    --success: #10B981;
    --success-light: #D1FAE5;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --warning: #F59E0B;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 40px rgba(74, 144, 217, 0.15);
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 50%, #EEF2FF 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Background Pattern ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(74, 144, 217, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(123, 104, 184, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo {
    height: 45px;
    width: auto;
    mix-blend-mode: screen;
    transition: all var(--transition-base);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-text {
    color: var(--white);
    font-weight: 500;
    font-size: 1rem;
    opacity: 0.9;
    letter-spacing: 0.02em;
}

/* ===== Main Content ===== */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 160px);
}

.form-container {
    width: 100%;
    max-width: 720px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
    overflow: hidden;
    animation: slideUp 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

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

/* ===== Progress Steps ===== */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-bounce);
    border: 2px solid transparent;
    backdrop-filter: blur(5px);
}

.step.active .step-number {
    background: var(--white);
    color: var(--primary-blue);
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
    border-color: var(--white);
    animation: pulse 0.5s ease;
}

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

.step-label {
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.step.active .step-label,
.step.completed .step-label {
    opacity: 1;
    font-weight: 600;
}

.step-line {
    width: 70px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    transition: all var(--transition-base);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.step-line.completed {
    background: var(--white);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ===== Form ===== */
.form {
    padding: 2.5rem;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.form-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
    font-weight: 400;
}

/* ===== Form Grid ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: all var(--transition-base);
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-base);
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.input-wrapper input:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.input-wrapper select:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.input-wrapper select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.15);
    background-color: var(--white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.15);
    background: var(--white);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-blue);
    transform: scale(1.1);
}

.input-wrapper input.error {
    border-color: var(--error);
    background: var(--error-light);
}

.input-wrapper input.error ~ .input-icon {
    color: var(--error);
}

/* ===== Upload Area ===== */
.upload-container {
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.05) 0%, rgba(123, 104, 184, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-area:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.1) 0%, rgba(123, 104, 184, 0.1) 100%);
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.15) 0%, rgba(123, 104, 184, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-bounce);
}

.upload-icon svg {
    width: 36px;
    height: 36px;
}

.upload-area:hover .upload-icon {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 30px rgba(74, 144, 217, 0.2);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.375rem;
}

.upload-text {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.upload-formats {
    display: inline-block;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    color: var(--gray-600);
    font-size: 0.8rem;
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-weight: 500;
}

.upload-preview {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.upload-preview img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.remove-image {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--error) 0%, #DC2626 100%);
    color: var(--white);
    border: 3px solid var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-bounce);
    box-shadow: var(--shadow-md);
}

.remove-image:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: var(--shadow-lg);
}

.remove-image svg {
    width: 18px;
    height: 18px;
}

.upload-hint {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-align: center;
    font-style: italic;
}

/* ===== Buttons ===== */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-100);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 217, 0.45);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-secondary:hover svg {
    transform: translateX(-4px);
}

.btn-submit {
    min-width: 200px;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: 3rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow-2xl);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceIn 0.6s ease 0.2s both;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.modal-icon.success {
    background: linear-gradient(135deg, var(--success-light) 0%, #A7F3D0 100%);
    color: var(--success);
}

.modal-icon.error {
    background: linear-gradient(135deg, var(--error-light) 0%, #FECACA 100%);
    color: var(--error);
}

.modal-icon svg {
    width: 48px;
    height: 48px;
}

.modal-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.modal-text {
    color: var(--gray-500);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1rem;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    padding: 1.75rem;
    text-align: center;
}

.footer-text {
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        padding: 0.875rem 1rem;
    }
    
    .logo {
        height: 38px;
    }
    
    .nav-text {
        font-size: 0.875rem;
    }
    
    .main {
        padding: 1.5rem 1rem;
    }
    
    .form-container {
        border-radius: var(--radius-xl);
    }
    
    .progress-steps {
        padding: 1.5rem 1rem;
        gap: 0.25rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .step-line {
        width: 35px;
    }
    
    .form {
        padding: 1.75rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .input-group.full-width {
        grid-column: 1;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
        padding: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1.25rem;
    }
    
    .upload-icon {
        width: 64px;
        height: 64px;
    }
    
    .upload-icon svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 0.5rem 0.25rem;
    }
    
    .step-line {
        width: 25px;
    }
    
    .step-label {
        display: none;
    }
    
    .form-title {
        font-size: 1.375rem;
    }
    
    .form-subtitle {
        font-size: 0.9rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-icon {
        width: 80px;
        height: 80px;
    }
    
    .modal-icon svg {
        width: 40px;
        height: 40px;
    }
}

/* ===== Input Validation States ===== */
.input-wrapper input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: var(--error);
}

.input-wrapper input:valid:not(:placeholder-shown) {
    border-color: var(--success);
}

.input-wrapper input:valid:not(:placeholder-shown) ~ .input-icon {
    color: var(--success);
}

/* ===== Loading State ===== */
.btn.loading {
    pointer-events: none;
    opacity: 0.85;
    position: relative;
}

.btn.loading .btn-icon,
.btn.loading #submitText {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Focus Visible ===== */
:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 3px;
}

/* ===== Selection ===== */
::selection {
    background: rgba(74, 144, 217, 0.25);
    color: var(--gray-900);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-400) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
}

/* ===== Shake Animation ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.6s ease;
}

/* ===== Confetti Animation (for success) ===== */
@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}
