/* ==========================================================================
   InjuryUp — Conversational Form Styles
   Matching reference design: icons, checkboxes, clean card layout
   ========================================================================== */

:root {
    --iu-primary: #1a2e5a;
    --iu-primary-hover: #142447;
    --iu-primary-light: #eef1f7;
    --iu-accent: #f09020;
    --iu-accent-hover: #d97d14;
    --iu-success: #16a34a;
    --iu-success-light: #dcfce7;
    --iu-error: #dc2626;
    --iu-bg: #f5f5f5;
    --iu-card-bg: #ffffff;
    --iu-text: #1a2e5a;
    --iu-text-muted: #6b7280;
    --iu-border: #e5e5e5;
    --iu-border-hover: #1a2e5a;
    --iu-radius: 20px;
    --iu-radius-sm: 12px;
    --iu-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --iu-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrap — no background, inline flow, centered */
.injuryup-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--iu-font);
    color: var(--iu-text);
    padding: 24px;
    box-sizing: border-box;
    min-height: 520px;
}

/* ──────────────────────────────────────────────
   Logo — inline above progress bar
────────────────────────────────────────────── */
.injuryup-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 20px;
}

.injuryup-logo img {
    height: 72px;
    width: auto;
}

/* ──────────────────────────────────────────────
   Progress bar — same width as card
────────────────────────────────────────────── */
.injuryup-progress {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
}

.injuryup-progress__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
}

.injuryup-progress__back {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--iu-text);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.injuryup-progress__back:hover {
    opacity: 1;
}

.injuryup-progress__back[disabled] {
    opacity: 0.2;
    cursor: default;
}

.injuryup-progress__track {
    flex: 1;
    height: 8px;
    background: var(--iu-border);
    border-radius: 4px;
    overflow: hidden;
}

.injuryup-progress__bar {
    height: 100%;
    width: 0%;
    background: var(--iu-primary);
    transition: width var(--iu-transition);
    border-radius: 4px;
}

.injuryup-progress__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--iu-text);
    white-space: nowrap;
}

/* ──────────────────────────────────────────────
   Steps
────────────────────────────────────────────── */
/* Steps — all absolutely stacked so no layout shift on transition */
.injuryup-steps {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 400px;
}

.injuryup-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition:
        opacity var(--iu-transition),
        transform var(--iu-transition);
}

.injuryup-step--active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative; /* this one drives the container height */
}

.injuryup-step--exit {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* ──────────────────────────────────────────────
   Card
────────────────────────────────────────────── */
.injuryup-card {
    background: var(--iu-card-bg);
    border-radius: var(--iu-radius);
    padding: 48px 44px;
    max-width: 600px;
    width: 100%;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 20px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.injuryup-card--highlight {
    border-top: 4px solid var(--iu-success);
}

.injuryup-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--iu-success-light);
    color: var(--iu-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 24px;
}

/* SVG illustration above card title */
.injuryup-card__illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.injuryup-card__illustration svg {
    width: 80px;
    height: 80px;
}

.injuryup-card__title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 10px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.injuryup-card__subtitle {
    font-size: 16px;
    color: var(--iu-text-muted);
    margin: 0 0 36px;
    line-height: 1.5;
}

/* ──────────────────────────────────────────────
   Option buttons — icon left, label center, checkbox right
────────────────────────────────────────────── */
.injuryup-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.injuryup-option {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 22px;
    border: 2px solid var(--iu-border);
    border-radius: var(--iu-radius-sm);
    background: var(--iu-card-bg);
    cursor: pointer;
    font-size: 16px;
    font-family: var(--iu-font);
    color: var(--iu-text);
    text-align: left;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.injuryup-option:hover {
    border-color: var(--iu-border-hover);
    box-shadow: 0 0 0 1px var(--iu-border-hover);
}

.injuryup-option--selected {
    border-color: var(--iu-primary);
    background: var(--iu-primary-light);
    box-shadow: 0 0 0 1px var(--iu-primary);
}

/* Icon on left */
.injuryup-option__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    color: var(--iu-primary);
}

.injuryup-option__icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Label */
.injuryup-option__label {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
}

/* Checkbox indicator on right */
.injuryup-option__check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--iu-border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.injuryup-option--selected .injuryup-option__check {
    background: var(--iu-primary);
    border-color: var(--iu-primary);
}

.injuryup-option__check-icon {
    display: none;
}

.injuryup-option--selected .injuryup-option__check-icon {
    display: block;
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

/* Legacy key badge — hidden now, keeping for backwards compat */
.injuryup-option__key {
    display: none;
}

/* ──────────────────────────────────────────────
   Buttons
────────────────────────────────────────────── */
.injuryup-actions {
    margin-top: 36px;
}

.injuryup-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 36px;
    border: none;
    border-radius: var(--iu-radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--iu-font);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}

.injuryup-btn:hover {
    transform: translateY(-1px);
}

.injuryup-btn:active {
    transform: translateY(0);
}

.injuryup-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.injuryup-btn--primary {
    background: var(--iu-accent);
    color: #fff;
}

.injuryup-btn--primary:hover:not(:disabled) {
    background: var(--iu-accent-hover);
}

.injuryup-btn--accent-wide {
    background: var(--iu-accent);
    color: #fff;
    width: 100%;
    justify-content: center;
    padding: 18px 36px;
    font-size: 18px;
}

.injuryup-btn--accent-wide:hover {
    background: var(--iu-accent-hover);
}

.injuryup-btn--secondary {
    background: var(--iu-bg);
    color: var(--iu-text);
    border: 1px solid var(--iu-border);
}

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

/* ──────────────────────────────────────────────
   Form fields
────────────────────────────────────────────── */
.injuryup-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.injuryup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.injuryup-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--iu-text);
}

.injuryup-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--iu-border);
    border-radius: var(--iu-radius-sm);
    font-size: 16px;
    font-family: var(--iu-font);
    color: var(--iu-text);
    background: var(--iu-card-bg);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.injuryup-input:focus {
    border-color: var(--iu-primary);
}

.injuryup-input--error {
    border-color: var(--iu-error);
}

/* Google Places autocomplete wrapper */
.injuryup-autocomplete-wrap {
    width: 100%;
}

.injuryup-autocomplete-wrap gmp-place-autocomplete {
    width: 100%;
    color-scheme: light; /* Force light mode regardless of OS preference */
    border: none;
    outline: none;
}

.injuryup-autocomplete-wrap gmp-place-autocomplete:focus-within {
    outline: none;
}

.injuryup-autocomplete-wrap gmp-place-autocomplete::part(input) {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--iu-border);
    border-radius: var(--iu-radius-sm);
    font-size: 16px;
    font-family: var(--iu-font);
    color: var(--iu-text);
    background: var(--iu-card-bg);
    box-sizing: border-box;
    outline: none;
}

.injuryup-autocomplete-wrap gmp-place-autocomplete::part(input):focus {
    border-color: var(--iu-primary);
}

/* Checkbox */
.injuryup-field--checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
}

.injuryup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--iu-text-muted);
    cursor: pointer;
}

.injuryup-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--iu-primary);
}

.injuryup-checkbox-label a {
    color: var(--iu-primary);
    text-decoration: underline;
}

/* Error text */
.injuryup-error {
    color: var(--iu-error);
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* ──────────────────────────────────────────────
   Spinner
────────────────────────────────────────────── */
.injuryup-processing {
    text-align: center;
}

.injuryup-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--iu-border);
    border-top-color: var(--iu-primary);
    border-radius: 50%;
    animation: injuryup-spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

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

/* ──────────────────────────────────────────────
   Success benefits
────────────────────────────────────────────── */
.injuryup-success {
    text-align: center;
}

.injuryup-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
    text-align: center;
}

.injuryup-benefit {
    padding: 20px 14px;
    background: var(--iu-bg);
    border-radius: var(--iu-radius-sm);
}

.injuryup-benefit__icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.injuryup-benefit__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
}

.injuryup-benefit__text {
    font-size: 13px;
    color: var(--iu-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* ──────────────────────────────────────────────
   Responsive
────────────────────────────────────────────── */
@media (max-width: 640px) {
    .injuryup-card {
        padding: 32px 20px;
    }

    .injuryup-card__title {
        font-size: 22px;
    }

    .injuryup-card__subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .injuryup-option {
        padding: 14px 16px;
        gap: 12px;
    }

    .injuryup-option__icon {
        width: 36px;
        height: 36px;
    }

    .injuryup-option__icon svg {
        width: 22px;
        height: 22px;
    }

    .injuryup-benefits {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .injuryup-benefit {
        padding: 16px;
    }

    .injuryup-btn {
        width: 100%;
        justify-content: center;
    }
}
