/* ============================================================
   shared.css — All shared styles for broker-forms
   Loaded by both index.html (short form) and application.html (wizard)
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES & RESET
   ============================================================ */

:root {
    --color-accent: #FF4F52;
    --color-accent-dark: #E63840;
    --color-text: #1A1A1A;
    --color-text-secondary: #555;
    --color-border: #D1D5DB;
    --color-border-hover: #9CA3AF;
    --color-placeholder: #9CA3AF;
    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-bg-dark: radial-gradient(ellipse at 30% 50%, #3d3d3d 0%, #2d2d2d 40%, #1a1a1a 100%);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-white);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   2. HEADER
   ============================================================ */

.header {
    background: radial-gradient(ellipse at 30% 50%, #3d3d3d 0%, #2d2d2d 40%, #1a1a1a 100%);
    border-bottom: 2px solid var(--color-accent);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-broker-logo {
    flex-shrink: 1;
    min-width: 0;
}

.header-broker-logo img {
    height: 40px;
    max-width: 180px;
    width: auto;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.header-carma {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-carma img {
    height: 32px;
    max-width: 120px;
    width: auto;
    display: block;
    object-fit: contain;
}

.header-carma span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* ============================================================
   3. MAIN (short form centered layout)
   ============================================================ */

main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 24px 80px;
}

/* ============================================================
   4. FORM CARD & HEADINGS
   ============================================================ */

.form-card {
    background: var(--color-white);
    width: 100%;
    max-width: 560px;
}

.form-heading {
    margin-bottom: 40px;
}

.form-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.form-heading h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.15;
    margin-bottom: 10px;
}

.form-heading p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

.form-divider {
    height: 2px;
    width: 48px;
    background: var(--color-accent);
    border-radius: 2px;
    margin: 20px 0 36px;
}

/* ============================================================
   5. FORM FIELDS
   ============================================================ */

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 7px;
    letter-spacing: 0.1px;
}

label .required {
    color: #FF4F52;
    margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1A1A1A;
    background: #ffffff;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #FF4F52;
    box-shadow: 0 0 0 3px rgba(255, 79, 82, 0.1);
}

input:hover:not(:focus),
select:hover:not(:focus) {
    border-color: #9CA3AF;
}

textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1A1A1A;
    background: #ffffff;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:hover:not(:focus) {
    border-color: #9CA3AF;
}

/* Radio & Checkbox groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 0;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
    /* reset inherited input styles */
    border: none;
    border-radius: 0;
    padding: 0;
    appearance: auto;
    -webkit-appearance: auto;
}

/* Currency input */
.currency-input {
    position: relative;
}

.currency-input::before {
    content: '$';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
    z-index: 1;
}

.currency-input input {
    padding-left: 28px;
}

/* ============================================================
   6. BUTTONS
   ============================================================ */

.btn-submit {
    width: 100%;
    height: 52px;
    background: #FF4F52;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s, transform 0.1s;
}

.btn-submit:hover {
    background: #E63840;
}

.btn-submit:active {
    transform: scale(0.99);
}

.btn-outline {
    width: 100%;
    height: 52px;
    background: transparent;
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn-outline:hover {
    border-color: var(--color-border-hover);
    background: var(--color-gray-50);
}

.btn-outline:active {
    transform: scale(0.99);
}

.btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

/* ============================================================
   7. SUCCESS & ERROR STATES
   ============================================================ */

.form-success {
    display: none;
    text-align: center;
    padding: 48px 0;
}

.form-success.visible {
    display: block;
}

.form-success-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 79, 82, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
}

.form-success h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.form-success p {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

.form-error {
    border-left: 4px solid var(--color-accent);
    background: rgba(255, 79, 82, 0.05);
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--color-accent);
    margin-bottom: 20px;
}

/* ============================================================
   8. WIZARD LAYOUT
   ============================================================ */

.wizard-layout {
    display: flex;
    gap: 40px;
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.wizard-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.wizard-content {
    flex: 1;
    max-width: 700px;
}

/* ============================================================
   9. STEP INDICATOR
   ============================================================ */

.step-list {
    list-style: none;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-left: 3px solid transparent;
    padding-left: 16px;
    cursor: pointer;
    transition: border-left-color 0.15s;
}

.step-item.active {
    border-left-color: var(--color-accent);
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-item.upcoming .step-circle {
    background: #f1f5f9;
    color: var(--color-placeholder);
}

.step-item.active .step-circle {
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    background: white;
}

.step-item.completed .step-circle {
    background: var(--color-accent);
    color: white;
}

.step-item.skipped .step-circle {
    background: #f1f5f9;
    color: var(--color-placeholder);
}

.step-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.step-item.active .step-label {
    font-weight: 600;
    color: var(--color-text);
}

.step-item.skipped .step-label {
    font-style: italic;
}

/* ============================================================
   10. WIZARD STEP CONTENT
   ============================================================ */

.wizard-step {
    display: none;
}

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

/* Section titles */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.section-divider {
    height: 2px;
    width: 48px;
    background: var(--color-accent);
    border-radius: 2px;
    margin: 16px 0 32px;
}

/* ============================================================
   11. SKIP TOGGLE
   ============================================================ */

.skip-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-gray-50);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 28px;
    cursor: pointer;
}

.skip-toggle input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    /* reset inherited input styles */
    border: none;
    border-radius: 0;
    padding: 0;
    height: auto;
    appearance: auto;
    -webkit-appearance: auto;
}

.skip-toggle label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

.step-content.skipped {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   12. REPEATABLE CARDS
   ============================================================ */

.repeatable-card {
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    background: var(--color-gray-50);
    position: relative;
}

.repeatable-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.repeatable-card-title {
    font-size: 15px;
    font-weight: 600;
}

.repeatable-card-remove {
    font-size: 13px;
    color: var(--color-accent);
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.repeatable-card-remove:hover {
    text-decoration: underline;
}

.btn-add-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-accent);
    background: none;
    border: 1.5px solid var(--color-accent);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}

.btn-add-card:hover {
    background: rgba(255, 79, 82, 0.05);
}

/* ============================================================
   13. SUBSECTION HEADERS
   ============================================================ */

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    margin: 28px 0 16px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.subsection-title:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* ============================================================
   14. CONDITIONAL SECTIONS
   ============================================================ */

.conditional-section {
    display: none;
}

.conditional-section.visible {
    display: block;
}

/* ============================================================
   15. FOOTER
   ============================================================ */

.footer {
    background: radial-gradient(ellipse at 30% 50%, #3d3d3d 0%, #2d2d2d 40%, #1a1a1a 100%);
    padding: 24px 40px;
    text-align: center;
}

.footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   16. RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 768px) {
    .header-inner {
        padding: 0 20px;
    }

    .header-broker-logo img {
        height: 34px;
        max-width: 150px;
    }

    .header-carma img {
        height: 28px;
        max-width: 100px;
    }

    /* Wizard layout becomes vertical */
    .wizard-layout {
        flex-direction: column;
        padding: 32px 16px 64px;
    }

    .wizard-sidebar {
        width: 100%;
    }

    /* Step list becomes horizontal scrollable bar */
    .step-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
        padding-bottom: 8px;
        /* hide scrollbar visually but keep functionality */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .step-list::-webkit-scrollbar {
        display: none;
    }

    .step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        padding: 8px 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
    }

    .step-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-accent);
    }

    .wizard-content {
        max-width: 100%;
    }

    .header-inner {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    /* Single column form rows */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Heading size reduction */
    .form-heading h1 {
        font-size: 28px;
    }

    .section-title {
        font-size: 24px;
    }

    /* Main padding reduction */
    main {
        padding: 40px 16px 60px;
    }

    .wizard-layout {
        padding: 24px 16px 48px;
    }

    .header-inner {
        padding: 0 16px;
        height: 60px;
    }

    .header-broker-logo img {
        height: 28px;
        max-width: 130px;
    }

    .header-carma {
        gap: 5px;
    }

    .header-carma img {
        height: 22px;
        max-width: 90px;
    }

    .header-carma span {
        font-size: 10px;
    }

    .footer {
        padding: 20px 16px;
    }
}
