:root {
    /* Maroon Theme Colors */
    --primary-color: #8A1538;     /* Deep Maroon */
    --primary-hover: #600f27;     /* Darker Maroon */
    --secondary-color: #FDF8F5;   /* Soft warm background */
    --secondary-hover: #F2E6E1;
    --text-primary: #2D141C;      /* Very dark maroon-tinted grey */
    --text-secondary: #6B5B61;
    --danger: #DC2626;
    --success: #059669;
    --border-color: #E2D5D9;
    --bg-color: #FAF5F5;
    --card-bg: rgba(255, 255, 255, 0.95);
    
    /* Shadows & Radii */
    --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 25px -5px rgba(138, 21, 56, 0.15), 0 8px 10px -6px rgba(138, 21, 56, 0.1);
    --shadow-glow: 0 0 20px rgba(138, 21, 56, 0.2);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
    /* smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Background aesthetic decorations */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #FFF9F9;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #8A1538; /* Maroon */
    animation: float 10s ease-in-out infinite alternate;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #D4AF37; /* Subtle Gold to complement maroon */
    animation: float 12s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Main Container */
.container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

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

.brand-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
    background-color: var(--primary-color);
    padding: 15px;
    border-radius: var(--radius-md);
}

.form-header h1 {
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Progress bar */
.progress-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
    max-width: 100%;
    padding: 0 1rem;
}

.progress-container::before {
    content: '';
    background-color: var(--border-color);
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    height: 4px;
    width: calc(100% - 2rem);
    z-index: 1;
    border-radius: 2px;
}

.progress {
    background-color: var(--primary-color);
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    height: 4px;
    width: 0%;
    z-index: 1;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.circle {
    background-color: #fff;
    color: var(--text-secondary);
    border: 3px solid var(--border-color);
    border-radius: 50%;
    height: 44px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.4s ease;
    font-size: 1.1rem;
    position: relative;
    background: var(--card-bg);
}

.circle.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(138, 21, 56, 0.15);
}

.circle.completed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

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

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

.step-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.step-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

/* Inputs & Labels */
label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input, select, textarea {
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px; /* Prevents iOS zoom */
    color: var(--text-primary);
    background-color: #fff;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.1);
    background-color: #fff;
}

input::placeholder, textarea::placeholder {
    color: #A3969A;
}

small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: block;
}

input[type="file"] {
    padding: 0.6rem;
    background: var(--bg-color);
    border: 2px dashed #D5C8CC;
    cursor: pointer;
    border-radius: var(--radius-md);
    text-align: center;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #FFF5F7;
}

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

.btn {
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-next, .btn-submit {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(138, 21, 56, 0.25);
}

.btn-next:hover, .btn-submit:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 15px rgba(138, 21, 56, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid #EAD8DC;
}

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

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 1rem;
}

.success-message.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: #ECFCCB;
    color: var(--success);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0 10px rgba(236, 252, 203, 0.5);
}

.success-message h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Validation styling */
.input-error {
    border-color: var(--danger) !important;
    background-color: #FEF2F2 !important;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    display: block;
    font-weight: 500;
}

/* =========================================================
   Mobile Optimization 
   ========================================================= */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 2.5rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }

    .form-actions {
        flex-direction: column-reverse; /* Shows Prev button below Next on mobile */
        gap: 0.75rem;
        padding-top: 1.25rem;
    }
    
    .btn {
        width: 100%;
        padding: 1rem 1.5rem; /* Larger touch targets */
    }
    
    .step-header h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
        background-color: #fff; /* Removes body background wrapping on tiny screens */
    }

    .background-decorations {
        display: none; /* Simplifies render on very small screens */
    }

    .container {
        padding: 2rem 1.25rem;
        border-radius: 0;
        box-shadow: none;
        border: none;
        min-height: 100vh; /* Full screen experience */
        display: flex;
        flex-direction: column;
    }

    .form-header h1 {
        font-size: 1.8rem;
    }

    .form-header p {
        font-size: 1rem;
    }

    /* Shrink the progress circles so they fit without overlap */
    .progress-container {
        padding: 0 0.5rem;
        margin-bottom: 2rem;
    }

    .circle {
        height: 36px;
        width: 36px;
        font-size: 1rem;
        border-width: 2px;
    }

    .circle.active {
        box-shadow: 0 0 0 3px rgba(138, 21, 56, 0.15);
    }

    label {
        font-size: 0.9rem;
    }
    
    input, select, textarea {
        font-size: 16px; /* Must remain 16px on iOS to prevent auto-zoom */
        padding: 0.75rem 0.85rem;
    }
}
