/* =============================================================
   Gratus Inc. — Application Form
   Styled after the NeitClem "Report a Claim" reference design.
   Colors inherit from main.css (--accent-color, --heading-color, etc.)
   ============================================================= */

/* ---------------------------------------------------------------
   Page layout
--------------------------------------------------------------- */
body {
    background-color: #f4f6f9;
    padding: 32px 14px 60px;
    min-height: 100vh;
}

/* ---------------------------------------------------------------
   Form Card  (white card, subtle shadow + border)
--------------------------------------------------------------- */
.form-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09);
    border: 1px solid #e2e6ea;
    padding: 40px 48px;
    max-width: 860px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------
   Header / Brand
--------------------------------------------------------------- */
.form-header {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid #dee2e6;
}

.form-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 14px;
    transition: transform 0.3s ease;
}

.form-logo:hover { transform: scale(1.04); }

.form-email-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    background: #f4f5f7;
    border: 1px solid #d1d5db;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    margin-bottom: 10px;
    text-decoration: none;
}

.form-email-badge:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.form-tagline {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

/* ---------------------------------------------------------------
   Step Progress
--------------------------------------------------------------- */
.step-progress { margin-bottom: 32px; }

.step-bar-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.step-bar-fill {
    height: 100%;
    width: 25%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-labels {
    display: flex;
    justify-content: space-between;
}

.step-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    text-align: center;
    flex: 1;
    padding: 0 2px;
    transition: color 0.25s, font-weight 0.25s;
}

.step-label.active {
    color: var(--accent-color);
    font-weight: 700;
}

.step-label.completed {
    color: #6b7280;
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Section Titles  (matches .form-section-title on reference)
--------------------------------------------------------------- */
.form-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 22px;
}

/* ---------------------------------------------------------------
   Labels  (matches .form-label on reference)
--------------------------------------------------------------- */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-label .bi {
    color: var(--accent-color);
    font-size: 12px;
    flex-shrink: 0;
}

/* Required star */
.required-star,
.form-label .required-star {
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    margin-left: 1px;
}

/* ---------------------------------------------------------------
   Inputs / Selects / Textareas
   Flat-bottom style — matches NeitClem reference exactly
--------------------------------------------------------------- */
.form-control,
.form-select {
    background-color: #f4f5f7 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid #c8cdd4 !important;
    border-radius: 4px 4px 0 0 !important;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
    color: #111827 !important;
    transition: border-color 0.2s, background-color 0.2s !important;
    width: 100%;
    box-shadow: none !important;
    outline: none;
}

.form-control::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Auto-capitalize text inputs */
.capitalize-input { text-transform: capitalize; }

.form-control:focus,
.form-select:focus {
    background-color: #eef0f4 !important;
    border-bottom-color: var(--accent-color) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Validation states */
.form-control.is-invalid,
.form-select.is-invalid {
    border-bottom: 2px solid #dc2626 !important;
    background-color: #fef2f2 !important;
    box-shadow: none !important;
    background-image: none !important;
}

.form-control.is-valid,
.form-select.is-valid {
    border-bottom: 2px solid #16a34a !important;
    background-color: #f4f5f7 !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Override Bootstrap select arrow to keep it visible */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 36px !important;
}

textarea.form-control {
    resize: vertical;
    min-height: 44px !important;
    height: 44px;
    line-height: 1.6;
}

input[type="date"].form-control { min-height: 42px; }

.valid-feedback   { font-size: 0.78rem; color: #15803d; margin-top: 4px; }
.invalid-feedback { font-size: 0.78rem; color: #dc2626; margin-top: 4px; }

/* ---------------------------------------------------------------
   Checkboxes — explicitly reset from .form-control !important rules
--------------------------------------------------------------- */
.check-list { display: flex; flex-direction: column; gap: 2px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    padding-left: 10px !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.form-check:hover { background: #f4f5f7; }

.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
    width: 17px !important;
    height: 17px !important;
    min-height: unset !important;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-left: 6px !important;
    flex-shrink: 0;
    border: 2px solid #c8cdd4 !important;
    border-radius: 3px !important;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    background-color: #ffffff !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.form-check-input[type="checkbox"]:checked,
.form-check-input[type="radio"]:checked {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
    background-size: 12px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.form-check-input[type="checkbox"]:focus,
.form-check-input[type="radio"]:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 75%) !important;
    border-color: var(--accent-color) !important;
    outline: none !important;
}

.form-check-label {
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    padding-top: 1px;
    line-height: 1.5;
}

/* Checkbox group error */
.checkbox-invalid {
    display: none;
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 4px;
    padding: 0 2px;
}

.checkbox-invalid.show { display: block; }

/* ---------------------------------------------------------------
   Inner cards (career prefs, resume)
   Matches reference's left-border accent block style
--------------------------------------------------------------- */
.inner-card {
    border-left: 4px solid var(--accent-color);
    padding: 18px 20px;
    background: #fafbfc;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
}

.inner-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #374151;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.inner-card-title .bi {
    color: var(--accent-color);
    font-size: 13px;
}

/* ---------------------------------------------------------------
   Interview question text (shown above the answer field)
--------------------------------------------------------------- */
.question-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: #f4f5f7;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 4px 4px 0;
}

/* ---------------------------------------------------------------
   "Other" reveal
--------------------------------------------------------------- */
.other-reveal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 4px 4px 0;
    padding: 14px 16px;
    margin-top: 10px;
    display: none;
    animation: fadeInUp 0.25s ease both;
}

/* ---------------------------------------------------------------
   File Upload Zone
--------------------------------------------------------------- */
.file-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 24px 20px;
    text-align: center;
    background: #f4f5f7;
    cursor: pointer;
    transition: all 0.2s;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--accent-color);
    background: #eaf0ea;
}

.file-drop-zone input[type="file"] { display: none; }

.file-drop-icon {
    font-size: 26px;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.file-drop-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.file-drop-text strong { color: #374151; }

.file-drop-hint { font-size: 0.78rem; color: #9ca3af; }

.file-selected-name {
    display: none;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* ---------------------------------------------------------------
   Policy / Consent Box  — blue accent tint
--------------------------------------------------------------- */
.policy-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 20px;
    transition: border-color 0.2s, background 0.2s;
}

.policy-box.has-error {
    background: #fff5f5;
    border-color: #fca5a5;
}

#policyFeedback {
    display: none;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-color);
}

.policy-box .form-check { padding: 0; gap: 12px; align-items: flex-start; }

.policy-box .form-check-label {
    font-size: 0.875rem;
    color: #1e3a5f;
    line-height: 1.55;
}

.policy-box .form-check-input[type="checkbox"] {
    border-color: #3b82f6 !important;
    margin-top: 6px !important;
    align-self: flex-start !important;
}

.policy-box .form-check-input[type="checkbox"]:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.policy-box .form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    border-color: #3b82f6 !important;
}

/* ---------------------------------------------------------------
   Review Step — matches reference modal review style
--------------------------------------------------------------- */
.review-intro {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 22px;
}

.review-intro-icon {
    font-size: 1.3rem;
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 1px;
}

.review-intro-text h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 3px;
}

.review-intro-text p {
    font-size: 0.82rem;
    color: var(--accent-color);
    margin: 0;
    line-height: 1.55;
}

/* Review blocks */
.review-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.review-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.review-block-head-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #6b7280;
}

.review-block-head-title .bi {
    color: var(--accent-color);
    font-size: 13px;
}

.review-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-color);
    background: transparent;
    border: 1.5px solid var(--accent-color);
    border-radius: 50px;
    padding: 3px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.review-edit-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.review-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 16px;
    border-top: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

/* First row — no top border (cells 1 and 2) */
.review-cell:nth-child(1),
.review-cell:nth-child(2) { border-top: none; }

/* Right column — no right border */
.review-cell:nth-child(even) { border-right: none; }

/* Full-width rows — span both columns, no right border */
.review-cell.review-cell-full {
    grid-column: 1 / -1;
    border-right: none;
}

.review-cell-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.review-cell-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.review-cell-value.empty {
    color: #9ca3af;
    font-weight: 400;
    font-style: italic;
    font-size: 0.85rem;
}

/* ---------------------------------------------------------------
   Navigation buttons
--------------------------------------------------------------- */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    gap: 12px;
}

/* Back / Previous button — same outlined style as Next */
.btn-gratus-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--default-font);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 50px;
    border: 2px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.btn-gratus-outline:hover {
    background: var(--accent-color);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Primary / Next — outlined pill, fills on hover (matches reference .btn-submit) */
.btn-gratus {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--default-font);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 50px;
    border: 2px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.btn-gratus:hover {
    background: var(--accent-color);
    color: #ffffff;
    transform: translateY(-1px);
}

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

.btn-gratus:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-color), transparent 60%);
    outline-offset: 2px;
}

.btn-gratus-lg {
    font-size: 1rem;
    padding: 12px 36px;
}

/* ---------------------------------------------------------------
   Loading Overlay
--------------------------------------------------------------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.loading-logo {
    width: 80px;
}

.loading-spinner {
    position: absolute;
    inset: 0;
    border: 4px solid #e5e7eb;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

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

.loading-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

/* ---------------------------------------------------------------
   Divider
--------------------------------------------------------------- */
.form-divider {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 28px 0;
}

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.form-footer {
    text-align: center;
    padding-top: 22px;
    margin-top: 32px;
    border-top: 1px solid #dee2e6;
    font-size: 0.8rem;
    color: #9ca3af;
}

.form-footer p { margin-bottom: 4px; }
.form-footer a { color: var(--accent-color); font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------
   Step visibility & animations
--------------------------------------------------------------- */
.form-step        { display: none; }
.form-step.active { display: block; animation: fadeInUp 0.35s ease both; }

@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------
   iOS font-size zoom fix
--------------------------------------------------------------- */
@supports (-webkit-touch-callout: none) {
    .form-control,
    .form-select,
    textarea.form-control { font-size: 16px; }
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (min-width: 768px) {
    body { padding: 40px 24px 70px; }
}

@media (max-width: 767px) {
    .form-card { padding: 28px 20px; }
    .form-step-title { font-size: 1rem; }
    .review-grid { grid-template-columns: 1fr; }
    .review-cell { border-right: none; border-top: none; border-bottom: 1px solid #e5e7eb; }
    .review-cell:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
    body { padding: 12px 8px 40px; }
    .form-card { padding: 20px 14px; }
    .form-logo { width: 130px; }
    .form-nav { flex-direction: column-reverse; gap: 10px; }
    .btn-gratus-outline,
    .btn-gratus { width: 100%; justify-content: center; }
    .step-label { font-size: 9.5px; }
}
