/* ===================================================================
   Loading Modal Styles - Honest spinner + short promise
   =================================================================== */
.loading-modal-content {
    border-radius: 18px;
    border: 1px solid #D3C499;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 24px;
    background: #fff;
}

.loading-modal-body {
    display: flex;
    gap: 16px;
    align-items: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 5px solid rgba(0, 81, 43, 0.15);
    border-top-color: #00512b;
    animation: loadingSpin 0.9s linear infinite;
}

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

.loading-text-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loading-big-text {
    font-size: 20px;
    font-weight: 700;
    color: #00512b;
    letter-spacing: 0.2px;
}

.loading-simple-line {
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

.loading-micro-text {
    font-size: 13px;
    color: #595959;
    line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border-top-color: #00512b;
        border-right-color: #00512b;
    }
}

/* ===================================================================
   Skip Link for Keyboard Navigation (WCAG 2.1 AA)
   =================================================================== */ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #005288;
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #D3C499;
    outline-offset: 2px;
}

/* ===================================================================
   Base Styles
   =================================================================== */
body {
    font-family:"Calibri", sans-serif;
    background-color: #f9f9f9;
    background-image: url("/static/background.png");
    background-size: cover;
    background-repeat: no-repeat;
    margin: 0;
    padding: 20px;
}


h1,h2 {
    color: #00512b; /* Darkened from #006325 for better contrast (4.5:1 ratio) */
}

h3 {
    color: #00512b;
    font-size: 1.15rem;
    font-weight: 600;
}


.connect-line {
  position: absolute;
  top: 50%; 
  left: 0;
  right: 0;
  height: 4px;
  background-color: #ccc; /* or your color */
  transform: translateY(-50%);
  z-index: 0; /* behind the circles */
}

.step-icons {
    background-color: #00512b; /* Updated for consistency */
    color: #fff;
    width: 80px;
    aspect-ratio: 1;
    border-radius: 50%;
}

.thin-large {
  font-size: 2.5rem;
  font-weight: 300;
}

.lawyer-info {
    background-color: #f1f1f1;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.email-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
}

/* ===================================================================
   Focus Styles for Accessibility (WCAG 2.1 AA)
   =================================================================== */
a:focus-visible {
    outline: 3px solid #005288;
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #005288;
    box-shadow: 0 0 0 3px rgba(0, 82, 136, 0.25);
    outline: none;
}

label {
    margin-bottom: 8px;
    font-weight: bold;
}


.form-control {
    padding: 8px;
    margin-bottom: 0;
    border: 1px solid #e1e1e1;
    background: #fff;
    border-radius: 4px;
}

.form-label {
    margin-bottom: 0.2em;
}

.btn-primary {
    margin-top: 2em;
    padding: 10px;
    background-color: #005288;
    color: #fff;
    border: 1px solid #005288;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn-primary:visited {
    background-color: #005288;
    border-color: #005288;
    color: #fff;
}

.btn-primary:focus-visible {
    outline: 3px solid #D3C499;
    outline-offset: 2px;
}

.btn-secondary {
    margin-top: 2em;
    padding: 10px;
    background-color: #5a6268; /* Darkened from #6c757d for better contrast */
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:focus-visible {
    outline: 3px solid #005288;
    outline-offset: 2px;
}

.dash-line-off {
    width: 100px;
    min-width: 50px;
    border-bottom: 4px dashed gray;
    position: absolute; 
    top: 50%; right: -50px; 
    transform: translateY(-50%);
}


.gold {
    color: #D3C499;
}

.green {
    color: #00512b !important; /* Darkened from #006225 for WCAG AA compliance */
}
.green-bg {
    background: #00512b; /* Darkened for consistency */
}

.blue {
    color: #005288;
}

.red {
    color: #b40c3c;
}

.step-circle {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.debug-panel {
    max-width: 52rem;
}

.debug-panel .debug-section + .debug-section {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1rem;
}

.debug-json {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0;
}

.step-active {
    border-color: #006325 !important;
}

.step-wait {
    border-color: #CCC !important;
}


.step-line-active {
    width: 100px;
    border-bottom: 4px solid #000;
    transform: translateY(-50%);
}
.step-line {
    width: 100px;
    border-bottom: 4px dashed #000;
    transform: translateY(-50%);
}

.application-history-row {
    align-items: end;
}

.application-history-row fieldset {
    margin-bottom: 0;
}

details {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fafafa;
    margin-bottom: 10px;
}
summary {
    font-weight: bold;
    cursor: pointer;
    outline: none;
}
details p {
    margin-top: 8px;
    font-size: 14px;
    color: #333; /* Darkened from #444 for better contrast */
}

.form-check-input {
    border-color: #666 !important;
    border-width: 2px;
}

.form-check-input:checked {
    border-color: #005288 !important;
    background-color: #005288 !important;
}

.form-check-label {
    font-weight: normal;
}



.category-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background:#D3C499;
    border-radius: var(--border-radius);
    padding: 12px 16px;
    border: 1px solid #bcd8c7;
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
}

.category-tag {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.category-name {
    font-weight: 600;
    font-size: 16px;
}

.category-path {
    font-size: 13px;
    color: #595959; /* Darkened from var(--gray-text) for WCAG AA contrast */
}

.muted {
    color: #595959; /* Darkened from var(--gray-text) for WCAG AA contrast */
    font-size: 14px;
}


.link-button {
    border-radius: 4px;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.primary {
    background: var(--green);
    color: #fff;
}

.secondary {
    background: #fff;
    border-color: #c7c7c7;
    color: #222;
}

.link-button {
    border: none;
    padding: 0;
    background: none;
    color: var(--green);
    text-decoration: underline;
}

.flex-spacer {
    flex: 1;
}

/* Multi-category selection styles */
.multi-category-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.category-card-selectable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.category-card-selectable:hover {
    background: #efefef;
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-card-selectable:focus {
    outline: 2px solid #005288;
    outline-offset: 2px;
}

.category-card-selectable.active {
    background: #D3C499;
    border-color: #006325;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0, 99, 37, 0.2);
}

.category-card-selectable.validation-error {
    border-color: #dc3545;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.category-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-desc {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    margin-top: 4px;
    line-height: 1.3;
}

.category-checkmark {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
}

.category-checkmark.visible {
    background: #006325;
    border-color: #006325;
    color: #fff;
}

.category-tag.active {
    color: #00512b; /* Match updated green */
    font-weight: 600;
}

.category-tag.inactive {
    color: #666; /* Darkened from #999 for WCAG AA contrast */
}

/* Manual selection card label */
.category-tag-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #006325;
    font-weight: 600;
    margin-bottom: 4px;
}

.manual-selection-card {
    border-style: dashed;
}

.manual-selection-card.active {
    border-style: solid;
}

/* ===================================================================
   Category Modal Styles
   =================================================================== */

.category-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.category-modal-backdrop.open {
    display: flex;
}

.category-modal {
    background: #fff;
    border-radius: 10px;
    max-width: 700px;
    width: 95%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.category-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e3e3e3;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.category-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.category-modal-subtitle {
    font-size: 14px;
    color: #444; /* Darkened from #555 for WCAG AA contrast */
}

.category-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.category-modal-close:hover {
    color: #555;
    background: #f0f0f0;
}

.category-modal-body {
    padding: 16px 20px;
    overflow: auto;
    flex: 1;
}

.category-search-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.category-search-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #111;
}

.category-search-input {
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #c7c7c7;
    font-size: 14px;
    font-family: inherit;
}

.category-search-input:focus {
    outline: none;
    border-color: #006325;
    box-shadow: 0 0 0 2px rgba(0, 99, 37, 0.1);
}

.category-list {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    max-height: 46vh;
    overflow-y: auto;
    background: #f9f9f9;
    padding: 4px;
}

.category-list-row {
    display: block;
    width: 100%;
    background: #fff;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 4px;
    text-align: left;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.08s ease, background 0.08s ease;
}

.category-list-row:hover {
    border-color: #006325;
    background: #f0faf4;
}

.category-list-row.selected {
    border-color: #006325;
    box-shadow: 0 0 0 1px rgba(0, 99, 37, 0.4);
    background: #e4f4ec;
}

.category-list-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-list-path {
    font-weight: 500;
    font-size: 14px;
    color: #111;
}

.category-list-description {
    font-size: 13px;
    color: #444; /* Darkened from #555 for WCAG AA contrast */
    line-height: 1.3;
}

.category-empty-state {
    padding: 20px 10px;
    font-size: 14px;
    color: #444; /* Darkened from #555 for WCAG AA contrast */
    text-align: center;
}

.category-modal-footer {
    padding: 10px 20px 14px 20px;
    border-top: 1px solid #e3e3e3;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Ensure modal buttons have compact, consistent sizing */
.category-modal-footer .btn {
    margin-top: 0; /* override global button top margin */
    padding: 8px 14px;
    min-height: 36px;
}

/* Clear/search button sizing and alignment */
.category-search-row .btn {
    margin-top: 0; /* override global button top margin */
    padding: 6px 12px;
    align-self: flex-end;
    height: auto;
}