@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

:root {
    --primary: #22c55e;
    --primary-dark: #15803d;
    --bg-gradient: radial-gradient(circle at top right, #dcfce7 0%, #f0fdf4 40%, #ffffff 100%);
    --glass-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(34, 197, 94, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    --text-main: #0f172a;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Modern Header */
.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 15px 25px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 36px;
    transition: transform 0.3s;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 80px 20px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.05), transparent 70%);
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 0px;
    background: linear-gradient(90deg, #16a34a, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Form Container */
.container {
    max-width: 750px;
    margin: -40px auto 0;
    padding: 0 15px;
    position: relative;
    z-index: 10;
}

/* Stepper Styles */
.stepper-wrapper {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 20px;
}

.stepper-wrapper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.stepper-progress {
    position: absolute;
    top: 15px;
    left: 20px;
    height: 2px;
    background: var(--primary);
    z-index: 2;
    width: 0%;
    transition: width 0.4s ease;
}

.step-indicator {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.step-indicator.active .step-circle {
    border-color: var(--primary);
    background: white;
    color: var(--primary);
    box-shadow: 0 0 0 4px #dcfce7;
}

.step-indicator.completed .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: none;
    /* Hidden on mobile mostly */
}

@media (min-width: 600px) {
    .step-label {
        display: block;
    }
}

/* Cards and Steps */
.form-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-lg);
    border: 1px solid white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.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);
    }
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
}

.section-title i {
    width: 32px;
    height: 32px;
    background: #dcfce7;
    color: var(--primary-dark);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Modern Inputs */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Responsive Fix for Mobile/Tablet */
@media (max-width: 768px) {
    .input-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .chips-grid {
        grid-template-columns: 1fr 1fr;
        /* Force 2 columns on mobile for chips usually looks better, or 1fr if content is wide */
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.25s ease;
    appearance: none;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow width */
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

/* Custom Select Arrow */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* Chips / Cards for Checkboxes */
.chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.chip-label {
    position: relative;
}

.chip-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 10px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
    color: #475569;
}

.chip-content i {
    font-size: 20px;
    color: #94a3b8;
    transition: color 0.2s;
}

.chip-label input:checked+.chip-content {
    background: #dcfce7;
    border-color: var(--primary);
    color: var(--primary-dark);
}

.chip-label input:checked+.chip-content i {
    color: var(--primary);
}

/* File Upload Modern */
.file-upload-box {
    border: 2px dashed #cbd5e1;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.file-input {
    padding: 10px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 15px;
}

.btn-nav {
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 15px;
    flex: 1;
}

.btn-prev {
    background: #e2e8f0;
    color: #475569;
}

.btn-prev:hover {
    background: #cbd5e1;
}

.btn-next {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-next:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-next:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(34, 197, 94, 0.5);
}

.submit-btn:hover::after {
    left: 100%;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Messages */
.msg {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.msg.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.msg.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Inline Errors */
.error-text {
    color: #991b1b;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* Mobile App Styles */
.mobile-header {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 101;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-main);
}

.mobile-header a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 18px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
}

@media (max-width: 650px) {
    body {
        padding-bottom: 90px;
        background: #fff;
    }

    /* More space for nav */
    .glass-header {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .hero {
        display: none;
    }

    .container {
        margin-top: 0;
        padding: 0;
    }

    .stepper-wrapper {
        padding: 15px 20px;
        background: #fff;
        margin-bottom: 0;
        position: sticky;
        top: 55px;
        /* Below header */
        z-index: 99;
        border-bottom: 1px solid #f1f5f9;
    }

    .stepper-wrapper::before,
    .stepper-progress {
        top: 30px;
        /* Adjust for indicator alignment */
    }

    .form-section {
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 25px 20px 0;
        margin-bottom: 40px;
        /* Space above footer */
    }

    .nav-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
        z-index: 200;
        margin-top: 0;
        border-top: 1px solid #f1f5f9;
        max-width: 100vw;
        /* Prevent overflow */
    }

    .btn-nav {
        padding: 16px;
        font-size: 16px;
    }

    .input-group,
    .input-grid {
        gap: 15px;
    }

    input[type="text"],
    input[type="tel"],
    select,
    textarea {
        background: #f8fafc;
        border-color: #cbd5e1;
        font-size: 16px;
        /* Prevent zoom */
        padding: 16px;
    }
}