:root {
    /* NEW: Virgin Australia Brand Palette */
    --va-purple: #512698;
    --va-pink: #D6083B;
    --va-bg-light: #F4F6FE; /* Kept light bg from original */
    --va-grey-light: #D8DCE6;
    --va-text-primary: #222;
    --va-text-secondary: #6B7280;
    --va-white: #FFFFFF;
    --status-pending: #ffa500;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--va-bg-light);
    color: var(--va-text-primary);
}

header {
    background-color: var(--va-white);
    padding: 1em;
    text-align: center;
    border-bottom: 1px solid var(--va-grey-light);
}
.header-logo {
    max-width: 180px;
    margin-bottom: 0.5em;
}
header h1 {
    margin: 0;
    font-size: 1.5em;
    color: var(--va-purple); /* Updated color */
}

main {
    max-width: 700px;
    margin: 0 auto;
    padding: 1em;
}

form {
    background: var(--va-white);
    padding: 2em;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 42, 108, 0.05);
    overflow: hidden; /* Prevents long steps from overlapping */
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2em;
    gap: 0.5em;
}
.step {
    flex: 1;
    height: 6px;
    background-color: var(--va-grey-light);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}
.step.active {
    background-color: var(--va-purple); /* Updated color */
}

/* Form Steps */
.form-step {
    display: none;
    border: none;
    padding: 0;
    margin: 0;
    animation: fadeIn 0.5s;
}
.form-step.active-step {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

legend {
    font-weight: bold;
    font-size: 1.5em;
    padding: 0;
    margin-bottom: 1em;
    width: 100%;
    border-bottom: 1px solid var(--va-grey-light);
    padding-bottom: 0.5em;
    color: var(--va-purple); /* Updated color */
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: var(--va-text-secondary);
}
label small {
    font-weight: normal;
}


input, textarea {
    width: 100%;
    padding: 0.8em;
    margin-bottom: 1.2em;
    border: 1px solid var(--va-grey-light);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
}
input:focus, textarea:focus {
    outline: 2px solid var(--va-pink); /* Updated color */
    border-color: var(--va-purple); /* Updated color */
}

/* Button-based Dropdowns */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1.2em;
}
.option-button {
    flex-grow: 1;
    padding: 0.8em 1em;
    background-color: var(--va-bg-light);
    color: var(--va-purple); /* Updated color */
    border: 1px solid var(--va-grey-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
}
.option-button.selected {
    background-color: var(--va-pink); /* Updated color */
    color: var(--va-white);
    border-color: var(--va-pink); /* Updated color */
}

/* NEW: Save Details Button Style */
.save-button {
    display: block;
    width: 100%;
    padding: 0.8em 1em;
    margin: 0.5em 0 1.5em 0;
    font-weight: bold;
    font-size: 0.9em;
    background-color: transparent;
    border: 2px solid var(--va-purple);
    color: var(--va-purple);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.save-button:hover {
    background-color: var(--va-bg-light);
}

/* Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    border-top: 1px solid var(--va-grey-light);
    padding-top: 1.5em;
}
.form-navigation button {
    padding: 0.8em 1.5em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}
#prevBtn {
    background-color: var(--va-grey-light);
    color: var(--va-text-primary);
}
#nextBtn, #submitBtn {
    background-color: var(--va-purple); /* Updated color */
    color: var(--va-white);
}

/* Conditional and Pending Sections */
.conditional-field { display: none; margin-top: 1em; }
.submissions { margin-top: 2em; }
#submission-list { padding-left: 0; }
#submission-list li {
    background: var(--va-white);
    padding: 1em; margin-bottom: 0.5em;
    border-radius: 8px; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    border-left: 5px solid var(--status-pending);
}
.status-pending::after {
    content: '⏳ Waiting';
    color: var(--status-pending);
    font-weight: bold;
}

footer { text-align: center; padding: 2em; color: #888; font-size: 0.9em; }
.sync-wrapper { display: flex; align-items: center; gap: 1em; margin-bottom: 1em; }
#sync-button {
    background-color: #28a745;
    color: white;
    padding: 0.5em 1em;
    font-size: 0.9em;
    width: auto;
    border-radius: 8px;
    border: none;
}
#attachment-note { font-weight: normal; color: #666; }
input[type="file"]:disabled { cursor: not-allowed; background-color: #f4f4f4; }