@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

/* ── Variables ───────────────────────────────────────── */
:root {
    --ssh-navy:    #1B3564;
    --ssh-navy-dk: #122448;
    --ssh-gold:    #F7941D;
    --ssh-gold-dk: #d97e10;
    --ssh-blue:    #2C5F9E;
    --ssh-white:   #ffffff;
    --ssh-bg:      #f5f7fb;
    --ssh-border:  #d8dfe8;
    --ssh-text:    #1e2d40;
    --ssh-muted:   #6b7a90;
    --ssh-error:   #dc3545;
    --ssh-success: #198754;
    --ssh-radius:  6px;
}

/* ── Wrapper ─────────────────────────────────────────── */
.ssh-grant-wrap {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: var(--ssh-text);
    font-size: 14px;
    line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────── */
.ssh-form-header {
    background: var(--ssh-navy);
    color: #fff;
    padding: 28px 40px;
    border-radius: var(--ssh-radius) var(--ssh-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 24px;
}
.ssh-header-logo img {
    height: 60px;
    width: auto;
}
.ssh-header-text {
    flex: 1;
}
.ssh-header-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}
.ssh-header-sub {
    font-size: 13px;
    color: rgba(255,255,255,.72);
    margin-top: 4px;
}
.ssh-gold-bar { height: 5px; background: var(--ssh-gold); }

/* ── Application Window Notice ───────────────────────── */
.ssh-window-notice {
    background: #fff8ee;
    border: 1.5px solid var(--ssh-gold);
    border-radius: var(--ssh-radius);
    padding: 11px 18px;
    font-size: 13.5px;
    color: var(--ssh-text);
    margin: 14px 0;
    line-height: 1.5;
}
.ssh-window-notice strong { color: var(--ssh-navy); }

/* ── Progress bar ────────────────────────────────────── */
.ssh-progress-bar {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--ssh-border);
    padding: 18px 20px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2px;
}
.ssh-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 52px;
    flex: 1;
}
.ssh-step-connector {
    flex: 1;
    height: 2px;
    background: var(--ssh-border);
    margin-top: 15px;
    min-width: 12px;
}
.ssh-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ssh-bg);
    border: 2px solid var(--ssh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--ssh-muted);
    transition: all .25s;
    flex-shrink: 0;
}
.ssh-step-label {
    font-size: 10px;
    color: var(--ssh-muted);
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}
.ssh-step-indicator.active .ssh-step-circle { background: var(--ssh-navy); border-color: var(--ssh-navy); color: #fff; }
.ssh-step-indicator.active .ssh-step-label  { color: var(--ssh-navy); font-weight: 700; }
.ssh-step-indicator.done   .ssh-step-circle { background: var(--ssh-gold); border-color: var(--ssh-gold); color: #fff; }
.ssh-step-indicator.done   .ssh-step-circle::after { content: '✓'; font-size: 13px; }
.ssh-step-indicator.done   .ssh-step-circle span   { display: none; }
.ssh-step-indicator.done   + .ssh-step-connector   { background: var(--ssh-gold); }

/* ── Form step container ─────────────────────────────── */
/* Step 1 shows by default; JS takes over once loaded */
.ssh-form-step {
    display: none;
}
.ssh-form-step[data-step="1"] {
    display: block;
    background: #fff;
    border: 1px solid var(--ssh-border);
    border-top: none;
    padding: 34px 40px 40px;
    border-radius: 0 0 var(--ssh-radius) var(--ssh-radius);
}
.ssh-step-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--ssh-navy) !important;
    border-left: 4px solid var(--ssh-gold) !important;
    padding-left: 12px !important;
    margin: 0 0 6px !important;
    border-bottom: none !important;
}
.ssh-step-desc {
    color: var(--ssh-muted);
    font-size: 13px;
    margin: 0 0 22px;
    line-height: 1.55;
}

/* ── Field groups ────────────────────────────────────── */
.ssh-field-group {
    margin-bottom: 18px;
}
.ssh-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ssh-text);
    margin-bottom: 5px;
}
.ssh-label .req     { color: var(--ssh-error); margin-left: 2px; }
.ssh-label .sub-req { color: var(--ssh-muted); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.ssh-field-hint {
    display: block;
    font-size: 12px;
    color: var(--ssh-muted);
    font-style: italic;
    margin-bottom: 6px;
    line-height: 1.5;
}
.ssh-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ssh-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.ssh-row-1 { display: grid; grid-template-columns: 1fr; }

.ssh-input {
    width: 100%;
    padding: 8px 11px;
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ssh-text);
    background: var(--ssh-bg);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.ssh-input:focus {
    outline: none;
    border-color: var(--ssh-navy);
    box-shadow: 0 0 0 3px rgba(27,53,100,.09);
    background: #fff;
}
.ssh-input.ssh-error { border-color: var(--ssh-error); }

.ssh-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ssh-text);
    background: var(--ssh-bg);
    resize: vertical;
    line-height: 1.6;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.ssh-textarea:focus {
    outline: none;
    border-color: var(--ssh-navy);
    box-shadow: 0 0 0 3px rgba(27,53,100,.09);
    background: #fff;
}
.ssh-textarea.ssh-error { border-color: var(--ssh-error); }

/* ── Category cards ──────────────────────────────────── */
.ssh-cat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.ssh-cat-card {
    border: 2px solid var(--ssh-border);
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.ssh-cat-card input[type="radio"] {
    position: absolute; top: 14px; right: 14px;
    width: 18px; height: 18px; accent-color: var(--ssh-navy); cursor: pointer;
}
.ssh-cat-card:hover { border-color: var(--ssh-blue); }
.ssh-cat-card.selected, .ssh-cat-card:has(input:checked) {
    border-color: var(--ssh-navy); background: rgba(27,53,100,.03);
}
.ssh-cat-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--ssh-gold); margin-bottom: 5px;
}
.ssh-cat-name { font-size: 13.5px; font-weight: 700; color: var(--ssh-navy); margin-bottom: 6px; }
.ssh-cat-desc { font-size: 12px; color: var(--ssh-muted); line-height: 1.45; }

/* ── Activity checkboxes ─────────────────────────────── */
.ssh-activities-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.ssh-activity-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 13px;
    background: var(--ssh-bg);
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    cursor: pointer;
    transition: border-color .2s;
    font-size: 12.5px;
}
.ssh-activity-item:hover  { border-color: var(--ssh-blue); }
.ssh-activity-item.checked,
.ssh-activity-item:has(input:checked) { border-color: var(--ssh-navy); background: rgba(27,53,100,.04); }
.ssh-activity-item.required-act { border-color: rgba(247,148,29,.35); }
.ssh-activity-item.required-act:has(input:checked) { border-color: var(--ssh-navy); background: rgba(27,53,100,.05); }

.ssh-act-check { display: none; } /* actual checkbox used */
.ssh-activity-item input[type="checkbox"] {
    width: 15px; height: 15px; margin-top: 2px;
    accent-color: var(--ssh-navy); flex-shrink: 0; cursor: pointer;
}
.ssh-act-content { line-height: 1.4; }
.ssh-act-badge {
    display: inline-block;
    font-size: 9.5px; font-weight: 700; text-transform: uppercase;
    background: var(--ssh-gold); color: #fff;
    padding: 1px 5px; border-radius: 3px;
    margin-right: 5px; vertical-align: middle;
}

/* ── Goals ───────────────────────────────────────────── */
.ssh-goals { display: flex; flex-direction: column; gap: 10px; }

/* ── Initials ────────────────────────────────────────── */
.ssh-initials {
    width: 100px !important;
    text-align: center;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 4px;
}

/* ── Budget ──────────────────────────────────────────── */
.ssh-budget-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.ssh-budget-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ssh-budget-table th {
    background: var(--ssh-navy); color: #fff;
    padding: 9px 11px; text-align: left;
    font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px;
}
.ssh-budget-table td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--ssh-border);
    vertical-align: middle;
}
.ssh-budget-table tbody tr:hover td { background: #fafbfc; }
.ssh-budget-table .ssh-input { background: #fff; }
.ssh-budget-table .budget-qty  { padding: 6px 4px; text-align: center; }
.ssh-budget-table .budget-cost { padding: 6px 6px; }
.ssh-budget-total-row td { background: var(--ssh-bg); padding: 10px 11px; }
.row-total { font-weight: 600; color: var(--ssh-navy); white-space: nowrap; }
.ssh-remove-row {
    background: none; border: none;
    color: var(--ssh-error); cursor: pointer;
    font-size: 17px; padding: 2px 5px; line-height: 1;
}
.ssh-remove-row:hover { opacity: .7; }
.ssh-add-budget-row {
    background: none;
    border: 1.5px dashed var(--ssh-blue);
    color: var(--ssh-blue);
    padding: 7px 16px;
    border-radius: var(--ssh-radius);
    cursor: pointer;
    font-size: 13px; font-weight: 600;
    transition: all .2s;
    font-family: inherit;
    margin-top: 4px;
}
.ssh-add-budget-row:hover { background: var(--ssh-blue); color: #fff; }

/* ── Certification block ─────────────────────────────── */
.ssh-cert-block {
    background: var(--ssh-bg);
    border: 1px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    font-size: 13.5px;
    line-height: 1.65;
}
.ssh-cert-block p { margin: 0 0 12px; }
.ssh-cert-heading {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--ssh-navy); margin-bottom: 12px;
}
.ssh-cert-sub {
    font-size: 12.5px; color: var(--ssh-muted); margin-bottom: 16px;
}
.ssh-cert-list { margin: 0 0 14px 18px; padding: 0; }
.ssh-cert-list li { margin-bottom: 6px; }
.ssh-cert-list ul { margin: 6px 0 0 20px; padding: 0; }
.ssh-cert-affirm {
    font-style: italic; color: var(--ssh-text);
    border-top: 1px solid var(--ssh-border);
    padding-top: 12px; margin-top: 4px !important;
    font-size: 13px;
}

/* ── Required reporting sections ────────────────────── */
.ssh-initial-section {
    background: #fff;
    border: 1px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    padding: 16px 20px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.65;
}
.ssh-initial-section p { margin: 0 0 10px; }
.ssh-initial-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--ssh-navy);
    border-left: 3px solid var(--ssh-gold);
    padding-left: 8px; margin-bottom: 10px;
}
.ssh-initial-row {
    display: flex; align-items: center; gap: 12px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--ssh-border);
}
.ssh-initial-row label {
    font-size: 12.5px; font-weight: 600; color: var(--ssh-text); white-space: nowrap;
}

/* ── Digital Signature Pad ───────────────────────────── */
.ssh-sig-wrap {
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    background: #fff;
    overflow: hidden;
    max-width: 540px;
    cursor: crosshair;
}
.ssh-sig-canvas {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
}
.ssh-sig-canvas.ssh-error-outline {
    outline: 2px solid var(--ssh-error);
}
.ssh-sig-clear-btn {
    background: none;
    border: 1px solid var(--ssh-border);
    color: var(--ssh-muted);
    padding: 5px 14px;
    border-radius: var(--ssh-radius);
    cursor: pointer;
    font-size: 12px;
    margin-top: 6px;
    font-family: inherit;
    transition: all .2s;
}
.ssh-sig-clear-btn:hover { border-color: var(--ssh-error); color: var(--ssh-error); }

/* ── Validation message ──────────────────────────────── */
.ssh-val-msg {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
    padding: 9px 14px;
    border-radius: var(--ssh-radius);
    font-size: 12.5px;
    margin-top: 12px;
}

/* ── Supporting Documents Upload ─────────────────────── */
.ssh-doc-upload-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.ssh-doc-upload-item {
    background: #fff;
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    padding: 14px 18px;
    transition: border-color .2s;
}
.ssh-doc-upload-item.ssh-doc-missing {
    border-color: #dc3545;
    background: #fff8f8;
}

.ssh-doc-upload-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ssh-navy);
    margin-bottom: 10px;
    line-height: 1.5;
}

.ssh-doc-required-badge {
    display: inline-block;
    background: var(--ssh-navy);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    margin-right: 7px;
    vertical-align: middle;
}
.ssh-doc-cat2-badge {
    background: var(--ssh-gold);
    color: #1a1a1a;
}

/* Hide the native file input — use the styled label instead */
.ssh-file-input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; overflow: hidden;
    clip: rect(0,0,0,0);
    pointer-events: none;
}

.ssh-file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: var(--ssh-light);
    border: 1.5px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ssh-navy);
    transition: background .15s, border-color .15s;
    user-select: none;
}
.ssh-file-label:hover {
    background: #e4e9f0;
    border-color: var(--ssh-navy);
}

.ssh-file-name {
    display: inline-block;
    margin-left: 10px;
    font-size: 12.5px;
    color: #4a5568;
    font-style: italic;
    word-break: break-all;
}

.ssh-doc-note {
    font-size: 11.5px;
    color: #6b7a90;
    margin-top: 14px;
}

/* ── Navigation ──────────────────────────────────────── */
.ssh-form-nav {
    display: flex;
    align-items: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--ssh-border);
}
.ssh-nav-spacer { flex: 1; }
.ssh-btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--ssh-radius);
    padding: 11px 28px;
    cursor: pointer;
    transition: background .2s, color .2s;
    border: none;
}
.ssh-btn-primary {
    background: var(--ssh-navy); color: #fff;
}
.ssh-btn-primary:hover { background: var(--ssh-navy-dk); }
.ssh-btn-primary:disabled { opacity: .65; cursor: not-allowed; }
.ssh-btn-secondary {
    background: transparent; color: var(--ssh-navy);
    border: 1.5px solid var(--ssh-navy);
}
.ssh-btn-secondary:hover { background: var(--ssh-navy); color: #fff; }
#ssh-btn-submit.ssh-btn { background: var(--ssh-gold); }
#ssh-btn-submit.ssh-btn:hover { background: var(--ssh-gold-dk); }

/* ── Success screen ──────────────────────────────────── */
.ssh-success-wrap {
    text-align: center;
    padding: 56px 40px;
    background: #fff;
    border: 1px solid var(--ssh-border);
    border-radius: var(--ssh-radius);
}
.ssh-success-icon {
    width: 64px; height: 64px;
    background: var(--ssh-success); color: #fff;
    font-size: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.ssh-success-wrap h2 { font-size: 22px; color: var(--ssh-navy); margin-bottom: 12px; }
.ssh-success-wrap p  { font-size: 14px; color: var(--ssh-text); max-width: 500px; margin: 0 auto 14px; }
.ssh-success-note    { font-size: 12.5px !important; color: var(--ssh-muted) !important; }
.ssh-success-table {
    margin: 14px auto 20px;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}
.ssh-success-table td {
    padding: 7px 16px;
    border: 1px solid var(--ssh-border);
}
.ssh-success-table tr:first-child td { background: var(--ssh-bg); }
.ssh-btn-dl {
    display: inline-block;
    background: var(--ssh-navy); color: #fff !important;
    padding: 12px 28px; border-radius: var(--ssh-radius);
    font-size: 14px; font-weight: 700; text-decoration: none !important;
    transition: background .2s;
}
.ssh-btn-dl:hover { background: var(--ssh-navy-dk); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 680px) {
    .ssh-form-header { padding: 18px 18px; flex-direction: column; text-align: center; }
    .ssh-form-step   { padding: 22px 18px; }
    .ssh-row-2,
    .ssh-row-3       { grid-template-columns: 1fr; }
    .ssh-cat-cards   { grid-template-columns: 1fr; }
    .ssh-activities-grid { grid-template-columns: 1fr; }
    .ssh-step-label  { display: none; }
}
