/* ═══════════════════════════════════════════════════════════
   ITS forms.its.com — Brand CSS
   Source: UI Foundation design tokens (Source Sans 3, brand-500 blue)
   ═══════════════════════════════════════════════════════════ */

/* ── FONT ── */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    /* Brand */
    --brand-50:  #b8e2fb;
    --brand-100: #96d1fa;
    --brand-200: #73bffa;
    --brand-300: #4faafb;
    --brand-400: #2b92fd;
    --brand-500: #0578ff;
    --brand-600: #0164ea;
    --brand-700: #0052d4;
    --brand-800: #0041bf;
    --brand-900: #0031a9;
    --brand-950: #002494;

    /* Gray */
    --gray-25:  #fdfdfd;
    --gray-50:  #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e9eaeb;
    --gray-300: #d5d7da;
    --gray-400: #a4a7ae;
    --gray-500: #717680;
    --gray-600: #535862;
    --gray-700: #414651;
    --gray-800: #252b37;
    --gray-900: #181d27;
    --gray-950: #0a0d12;

    /* Semantic */
    --error-50:  #fef3f2;
    --error-100: #fee4e2;
    --error-500: #f04438;
    --error-600: #d92d20;
    --error-700: #b42318;
    --success-50:  #ecfdf3;
    --success-600: #079455;
    --success-700: #067647;
    --warning-50:  #fffaeb;
    --warning-600: #dc6803;

    /* Shadows */
    --shadow-xs: 0px 1px 2px rgba(10,13,18,0.05);
    --shadow-sm: 0px 1px 3px rgba(10,13,18,0.1), 0px 1px 2px -1px rgba(10,13,18,0.1);
    --shadow-md: 0px 4px 6px -1px rgba(10,13,18,0.1), 0px 2px 4px -2px rgba(10,13,18,0.06);
    --shadow-lg: 0px 12px 16px -4px rgba(10,13,18,0.08), 0px 4px 6px -2px rgba(10,13,18,0.03);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Focus ring */
    --focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--brand-500);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.page-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 24px;
}
.page-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.page-header .logo { height: 36px; }
.page-header .header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}
.page-header .header-meta {
    margin-left: auto;
    font-size: 14px;
    color: var(--gray-500);
}

.page-main {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    font-size: 13px;
    text-align: center;
    padding: 20px 24px;
}
.page-footer a { color: var(--brand-300); text-decoration: none; }

/* ── FORM TYPE TABS ── */
.form-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 28px;
    overflow-x: auto;
}
.form-tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all 0.15s ease;
}
.form-tabs a:hover { color: var(--gray-900); background: rgba(255,255,255,0.6); }
.form-tabs a.active {
    background: #fff;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* ── CARDS ── */
.form-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}
.form-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-card-title .icon {
    width: 20px; height: 20px;
    color: var(--brand-500);
}
.form-card-desc {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 20px;
}
.form-card-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 20px 0;
}

/* ── FORM GRID ── */
.field-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px 20px;
}
.field-col-3  { grid-column: span 3; }
.field-col-4  { grid-column: span 4; }
.field-col-6  { grid-column: span 6; }
.field-col-8  { grid-column: span 8; }
.field-col-12 { grid-column: span 12; }

@media (max-width: 768px) {
    .field-col-3, .field-col-4, .field-col-6, .field-col-8 {
        grid-column: span 12;
    }
    .page-main { padding: 20px 16px 48px; }
    .form-card { padding: 20px 16px; }
    .form-tabs { flex-wrap: nowrap; }
    .form-tabs a { flex: none; padding: 8px 14px; font-size: 13px; }
}
@media (max-width: 480px) {
    .field-grid { gap: 12px; }
}

/* ── FORM FIELDS ── */
.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 4px;
}
.field-label .req { color: var(--error-600); font-weight: 400; }

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--gray-900);
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.field-input::placeholder,
.field-textarea::placeholder {
    color: var(--gray-400);
}
.field-input:hover, .field-select:hover, .field-textarea:hover {
    border-color: var(--gray-400);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--focus-ring);
}
.field-textarea { resize: vertical; min-height: 80px; }

/* Select arrow */
.field-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23717680' viewBox='0 0 16 16'%3E%3Cpath d='M4.47 5.97a.75.75 0 0 1 1.06 0L8 8.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Validation states */
.field-input.is-invalid, .field-select.is-invalid, .field-textarea.is-invalid {
    border-color: var(--error-500);
}
.field-input.is-invalid:focus, .field-select.is-invalid:focus {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--error-500);
}
.field-error {
    font-size: 13px;
    color: var(--error-600);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── RADIO / CHECKBOX ── */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}
.radio-item input[type="radio"],
.radio-item input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--brand-500);
    cursor: pointer;
    margin: 0;
}

/* ── SECTION SUBHEADING (leg groups) ── */
.section-sub {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    padding: 8px 0 4px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-sub .badge {
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
}
.section-sub .opt {
    font-weight: 400;
    color: var(--gray-400);
    font-size: 13px;
}

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--brand-600);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-primary:hover {
    background: var(--brand-700);
    box-shadow: var(--shadow-md);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── ALERTS ── */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}
.alert-success {
    background: var(--success-50);
    color: var(--success-700);
    border: 1px solid #bbf7d0;
}
.alert-error {
    background: var(--error-50);
    color: var(--error-700);
    border: 1px solid #fecaca;
}
.alert-warning {
    background: var(--warning-50);
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── NOSCRIPT ── */
.noscript-bar {
    background: var(--warning-50);
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── EVENT HERO ── */
.event-hero {
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    margin-bottom: 28px;
    color: #fff;
}
.event-hero h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
    line-height: 1.3;
}
.event-hero h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px;
    text-align: center;
    opacity: 0.9;
}
.event-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.event-info-list li {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 15px;
    line-height: 1.5;
}
.event-info-list li:last-child { border-bottom: 1px solid rgba(255,255,255,0.15); }
.event-info-list a { color: #fff; font-weight: 600; }
.event-hero-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 16px;
    font-style: italic;
    opacity: 0.85;
}
@media (max-width: 768px) {
    .event-hero { padding: 28px 20px; }
    .event-hero h2 { font-size: 22px; }
}

/* ── CONDITIONAL SECTIONS ── */
.cond-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
    margin-top: 0;
}
.cond-section.is-open {
    max-height: 800px;
    opacity: 1;
    margin-top: 16px;
}

/* ── VALIDATION FEEDBACK ── */
.error-summary {
    background: var(--error-50);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}
.error-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--error-700);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.error-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.error-summary-list li {
    font-size: 14px;
    color: var(--error-600);
    padding: 3px 0;
}
.error-summary-list li a {
    color: var(--error-700);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.field-input.touched:invalid,
.field-select.touched:invalid,
.field-textarea.touched:invalid {
    border-color: var(--error-500);
}

/* Shake animation on submit with errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── ITS BRANDING BAR ── */
.brand-bar {
    background: var(--gray-900);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-bar img { height: 28px; }
.brand-bar span {
    font-size: 12px;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Powered by badge (bottom of form) */
.powered-by {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--gray-400);
}
.powered-by img { height: 20px; opacity: 0.6; }

/* ── HONEYPOT ── */
.hp { position:absolute; left:-9999px; top:-9999px; opacity:0; height:0; width:0; overflow:hidden; }

/* ── FILE INPUT ── */
input[type="file"] {
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-600);
    padding: 8px 0;
}
input[type="file"]::file-selector-button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    margin-right: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
input[type="file"]::file-selector-button:hover {
    background: var(--gray-100);
}
