/* reset & base layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--gw-font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gw-ink-700);
    background-color: var(--gw-surface-2);
    padding: var(--gw-space-8) var(--gw-space-4);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Container card */
.container {
    width: 100%;
    max-width: 820px;
    background-color: var(--gw-surface);
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-lg);
    padding: var(--gw-space-8) var(--gw-space-8);
    box-shadow: var(--gw-shadow-lg);
    position: relative;
    overflow: hidden;
}

/* Corning Navy & Teal accent bar at top of card */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--gw-brand-600) 0%, var(--gw-brand-accent) 100%);
}

/* Header section */
.app-header {
    text-align: left;
    margin-bottom: var(--gw-space-8);
    padding-bottom: var(--gw-space-6);
    border-bottom: 1px solid var(--gw-line);
}

.header-logo-container {
    margin-bottom: var(--gw-space-4);
    display: flex;
    align-items: center;
}

.chamber-logo {
    max-height: 72px;
    width: auto;
    object-fit: contain;
}

.app-header h1 {
    font-family: var(--gw-font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--gw-ink-900);
    line-height: 1.2;
    margin-bottom: var(--gw-space-2);
}

.app-header p {
    color: var(--gw-ink-500);
    font-size: 1.05rem;
}

/* Fieldsets */
fieldset {
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-md);
    padding: var(--gw-space-6);
    margin-bottom: var(--gw-space-6);
    background-color: var(--gw-surface);
    transition: border-color var(--gw-duration-sm) var(--gw-ease-in-out), box-shadow var(--gw-duration-sm) var(--gw-ease-in-out);
}

fieldset:focus-within, fieldset:hover {
    border-color: var(--gw-brand-accent);
    box-shadow: var(--gw-shadow-sm);
}

legend {
    font-family: var(--gw-font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gw-ink-900);
    padding: 0 var(--gw-space-2);
    margin-bottom: var(--gw-space-4);
    line-height: 1.4;
}

/* Contact Details Section */
.contact-intro {
    font-size: 0.95rem;
    color: var(--gw-ink-500);
    margin-bottom: var(--gw-space-4);
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gw-space-4);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-1);
}

.form-field label {
    font-family: var(--gw-font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gw-ink-900);
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: var(--gw-space-3) var(--gw-space-4);
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-md);
    font-family: var(--gw-font-body);
    font-size: 0.95rem;
    color: var(--gw-ink-900);
    background-color: var(--gw-surface);
    outline: none;
    transition: border-color var(--gw-duration-sm) var(--gw-ease-in-out), box-shadow var(--gw-duration-sm) var(--gw-ease-in-out);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
    color: var(--gw-ink-300);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    border-color: var(--gw-brand-600);
    box-shadow: 0 0 0 3px rgba(14, 74, 96, 0.15);
}

/* Options Group for Radio & Checkbox Cards */
.options-group {
    display: flex;
    flex-direction: column;
    gap: var(--gw-space-2);
}

.option-card {
    display: flex;
    align-items: center;
    padding: var(--gw-space-3) var(--gw-space-4);
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-md);
    background-color: var(--gw-surface);
    cursor: pointer;
    user-select: none;
    transition: all var(--gw-duration-sm) var(--gw-ease-in-out);
}

.option-card:hover {
    border-color: var(--gw-brand-accent);
    background-color: var(--gw-brand-50);
    transform: translateY(-1px);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    accent-color: var(--gw-brand-600);
    width: 18px;
    height: 18px;
    margin-right: var(--gw-space-3);
    flex-shrink: 0;
    cursor: pointer;
}

.option-card span {
    font-size: 0.95rem;
    color: var(--gw-ink-700);
    transition: color var(--gw-duration-sm) var(--gw-ease-in-out);
}

.option-card:has(input:checked) {
    border-color: var(--gw-brand-600);
    background-color: var(--gw-brand-50);
    box-shadow: 0 0 0 1px var(--gw-brand-600);
}

.option-card:has(input:checked) span {
    color: var(--gw-ink-900);
    font-weight: 600;
}

/* Scale Group Layout (1 to 5 rating scales) */
.scale-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--gw-space-3);
}

.scale-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--gw-space-4) var(--gw-space-2);
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-md);
    background-color: var(--gw-surface);
    cursor: pointer;
    user-select: none;
    transition: all var(--gw-duration-sm) var(--gw-ease-in-out);
}

.scale-card input[type="radio"] {
    accent-color: var(--gw-brand-600);
    width: 16px;
    height: 16px;
    margin-bottom: var(--gw-space-2);
    cursor: pointer;
}

.scale-num {
    font-family: var(--gw-font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gw-ink-900);
    line-height: 1;
    margin-bottom: var(--gw-space-1);
}

.scale-label {
    font-size: 0.8rem;
    color: var(--gw-ink-500);
    line-height: 1.2;
}

.scale-card:hover {
    border-color: var(--gw-brand-accent);
    background-color: var(--gw-brand-50);
    transform: translateY(-2px);
    box-shadow: var(--gw-shadow-sm);
}

.scale-card:has(input:checked) {
    border-color: var(--gw-brand-600);
    background-color: var(--gw-brand-50);
    box-shadow: 0 0 0 1px var(--gw-brand-600);
}

.scale-card:has(input:checked) .scale-num {
    color: var(--gw-brand-600);
}

.scale-card:has(input:checked) .scale-label {
    color: var(--gw-ink-900);
    font-weight: 600;
}

/* Textarea styling */
.input-container {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    padding: var(--gw-space-3) var(--gw-space-4);
    border: 1px solid var(--gw-line);
    border-radius: var(--gw-radius-md);
    font-family: var(--gw-font-body);
    font-size: 0.95rem;
    color: var(--gw-ink-900);
    background-color: var(--gw-surface);
    resize: vertical;
    outline: none;
    transition: border-color var(--gw-duration-sm) var(--gw-ease-in-out), box-shadow var(--gw-duration-sm) var(--gw-ease-in-out);
}

textarea::placeholder {
    color: var(--gw-ink-300);
}

textarea:focus {
    border-color: var(--gw-brand-600);
    box-shadow: 0 0 0 3px rgba(14, 74, 96, 0.15);
}

/* Submit Button */
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--gw-space-4) var(--gw-space-6);
    background-color: var(--gw-brand-600);
    color: var(--gw-surface);
    font-family: var(--gw-font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--gw-radius-md);
    cursor: pointer;
    box-shadow: var(--gw-shadow-sm);
    transition: all var(--gw-duration-sm) var(--gw-ease-in-out);
    margin-top: var(--gw-space-4);
}

button[type="submit"]:hover {
    background-color: var(--gw-brand-700);
    transform: translateY(-1px);
    box-shadow: var(--gw-shadow-md);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: var(--gw-shadow-sm);
}

/* Status Message Alert */
#status-message {
    margin-top: var(--gw-space-6);
    padding: var(--gw-space-4);
    border-radius: var(--gw-radius-md);
    text-align: center;
    font-weight: 500;
    display: none;
    transition: all var(--gw-duration-sm) var(--gw-ease-in-out);
}

.success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    display: block !important;
}

.error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    display: block !important;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 35, 46, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--gw-duration-sm) var(--gw-ease-in-out);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Card */
.modal-card {
    background: var(--gw-surface);
    border-radius: var(--gw-radius-lg);
    padding: var(--gw-space-8) var(--gw-space-6);
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: var(--gw-shadow-lg);
    border: 1px solid var(--gw-line);
    transform: scale(0.9) translateY(10px);
    transition: transform var(--gw-duration-sm) var(--gw-ease-in-out);
}

.modal-backdrop.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-icon {
    font-size: 3.2rem;
    margin-bottom: var(--gw-space-2);
}

.modal-card h2 {
    font-family: var(--gw-font-heading);
    font-size: 1.8rem;
    color: var(--gw-ink-900);
    margin-bottom: var(--gw-space-2);
}

.modal-card p {
    font-size: 1rem;
    color: var(--gw-ink-500);
    line-height: 1.55;
    margin-bottom: var(--gw-space-6);
}

.modal-close-btn {
    position: absolute;
    top: var(--gw-space-3);
    right: var(--gw-space-4);
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--gw-ink-300);
    cursor: pointer;
    line-height: 1;
    transition: color var(--gw-duration-sm) var(--gw-ease-in-out);
}

.modal-close-btn:hover {
    color: var(--gw-ink-900);
}

.modal-action-btn {
    background-color: var(--gw-brand-600);
    color: var(--gw-surface);
    font-family: var(--gw-font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--gw-space-3) var(--gw-space-8);
    border: none;
    border-radius: var(--gw-radius-md);
    cursor: pointer;
    box-shadow: var(--gw-shadow-sm);
    transition: all var(--gw-duration-sm) var(--gw-ease-in-out);
}

.modal-action-btn:hover {
    background-color: var(--gw-brand-700);
    transform: translateY(-1px);
    box-shadow: var(--gw-shadow-md);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1001;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    body {
        padding: var(--gw-space-4) var(--gw-space-2);
    }
    
    .container {
        padding: var(--gw-space-5) var(--gw-space-4);
    }
    
    .chamber-logo {
        max-height: 56px;
    }
    
    .app-header h1 {
        font-size: 1.65rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .scale-group {
        grid-template-columns: 1fr;
    }
    
    .scale-card {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: var(--gw-space-3) var(--gw-space-4);
    }
    
    .scale-card input[type="radio"] {
        margin-bottom: 0;
        margin-right: var(--gw-space-3);
    }
    
    .scale-num {
        font-size: 1rem;
        margin-bottom: 0;
        margin-right: var(--gw-space-2);
    }
}
