* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

 :root {
     --ds-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
     --ds-text: #1f2937;
     --ds-muted: #4b5563;
     --ds-border: #d1d5db;
     --ds-surface: #ffffff;
     --ds-page: #f3f4f6;
     --ds-primary: #0073a8;
     --ds-primary-hover: #005f8b;
     --ds-focus: rgba(0, 115, 168, 0.25);
     --ds-danger: #b42318;
     --ds-danger-bg: #fef3f2;
     --ds-success: #067647;
     --ds-success-bg: #ecfdf3;
     --ds-warning: #b54708;
     --ds-warning-bg: #fffaeb;
     --ds-radius: 4px;
     --ds-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);
 }

body {
    font-family: var(--ds-font-family);
    color: var(--ds-text);
    background: var(--ds-page);
    min-height: 100vh;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.4;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--ds-surface);
    margin: 5% auto;
    border: none;
    border-radius: var(--ds-radius);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(17, 24, 39, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ds-primary);
    color: white;
    border-radius: var(--ds-radius) var(--ds-radius) 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

.close-btn {
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.submission-summary {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid var(--ds-primary);
}

.submission-summary p {
    margin: 8px 0;
    font-size: 16px;
}

.submission-summary span {
    font-weight: bold;
    color: #333;
}

.data-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.copy-btn {
    background: var(--ds-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
}

.json-container {
    background: #2d3748;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.json-display {
    background: #2d3748;
    color: #e2e8f0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .copy-btn {
        align-self: flex-end;
    }
    
    .json-display {
        font-size: 12px;
        padding: 15px;
    }
}

.container {
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    max-width: 800px;
    width: 100%;
    padding: 40px 40px 16px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.header h1 {
    color: var(--ds-text);
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header p {
    color: var(--ds-muted);
    font-size: 14px;
}

.test-data-btn {
    background: #0f766e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.test-data-btn:hover {
    background: #115e59;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ds-text);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    font-size: 14px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    background: #fff;
    color: var(--ds-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ds-primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--ds-focus);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--ds-danger);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.18);
}

.date-field-wrapper {
    position: relative;
}

.pii-field-wrapper {
    position: relative;
}

.pii-field-wrapper input {
    padding-right: 52px;
}

.pii-visibility-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #0070a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.pii-visibility-toggle:focus {
    outline: none;
}

.pii-eye {
    width: 22px;
    height: 22px;
}

.pii-eye-open {
    display: none;
}

.pii-eye-closed {
    display: block;
}

.pii-visibility-toggle[data-visible="true"] .pii-eye-open {
    display: block;
}

.pii-visibility-toggle[data-visible="true"] .pii-eye-closed {
    display: none;
}

.date-field-wrapper input {
    padding-right: 64px;
    color: #6d6d6d;
}

.date-field-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #7c7c7c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.date-field-icon svg {
    width: 28px;
    height: 28px;
}

.date-field-icon:focus {
    outline: none;
}

.date-picker-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: 320px;
    padding: 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.date-picker-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.date-picker-select {
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    background: #fff;
    color: var(--ds-text);
    font-size: 14px;
    padding: 6px 8px;
    font-family: inherit;
}

.date-picker-select:first-child {
    min-width: 130px;
}

.date-picker-nav {
    border: 0;
    background: transparent;
    color: var(--ds-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.date-picker-weekdays,
.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.date-picker-weekdays {
    margin-bottom: 8px;
    color: #5e5e5e;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.date-picker-day,
.date-picker-empty {
    width: 36px;
    height: 36px;
}

.date-picker-day {
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ds-text);
    font-size: 14px;
    cursor: pointer;
}

.date-picker-day:hover {
    background: #f3f7fb;
}

.date-picker-day.is-selected {
    background: var(--ds-primary);
    color: #fff;
}

.date-picker-empty {
    display: block;
}

.field-help {
    margin-top: 6px;
    color: var(--ds-muted);
    font-size: 12px;
}

.field-error {
    margin-top: 6px;
    color: var(--ds-danger);
    font-size: 12px;
}

.address-card {
    border: none;
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    padding: 18px 24px 24px;
    box-shadow: var(--ds-shadow);
}

.address-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0 0 12px;
}

.address-card .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.address-card .form-row input {
    margin: 0;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-top: none;
    border-radius: 0 0 var(--ds-radius) var(--ds-radius);
    box-shadow: var(--ds-shadow);
    max-height: 220px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ds-text);
    border-bottom: 1px solid var(--ds-border);
    transition: background 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--ds-accent-bg, #e8f0fe);
}

.autocomplete-loading {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--ds-text-light);
    text-align: center;
}

.repeatable-address-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.repeatable-address-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.repeatable-address-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.repeatable-address-card .address-card-title {
    margin-bottom: 0;
}

.repeatable-address-add,
.repeatable-address-remove {
    border: 1px solid var(--ds-primary);
    background: #ffffff;
    color: var(--ds-primary);
    border-radius: 8px;
    min-width: 132px;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.repeatable-address-add {
    align-self: flex-start;
    background: #ffffff;
    color: var(--ds-primary);
    box-shadow: none;
}

.repeatable-address-add:hover,
.repeatable-address-remove:hover {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.18);
    transform: translateY(-1px);
}

.repeatable-address-add:hover {
    color: var(--ds-primary);
    background: #ffffff;
    border-color: var(--ds-primary);
}

.repeatable-address-remove {
    min-width: 108px;
    background: #ffffff;
    color: var(--ds-primary);
}

/* Address List Styles */
.address-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.address-list-entry-card {
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    border-radius: var(--ds-radius);
    padding: 20px;
    box-shadow: var(--ds-shadow);
}

.address-list-entry-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.address-list-entry-card .form-row input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--ds-font-family);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.address-list-entry-card .form-row input:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 168, 0.1);
}

.address-list-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ds-text);
    margin: 0 0 16px;
}

.address-list-button-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.address-list-button-row .btn-primary,
.address-list-button-row .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--ds-font-family);
}

.address-list-button-row .btn-primary {
    background: var(--ds-primary);
    color: white;
}

.address-list-button-row .btn-primary:hover {
    background: var(--ds-primary-hover);
    box-shadow: 0 2px 8px rgba(0, 115, 168, 0.3);
}

.address-list-button-row .btn-secondary {
    background: white;
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
}

.address-list-button-row .btn-secondary:hover {
    background: var(--ds-page);
    border-color: var(--ds-text);
}

.address-list-table-wrapper {
    overflow-x: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    overflow: hidden;
}

.address-list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ds-surface);
    margin: 0;
}

.address-list-table thead {
    background: var(--ds-primary);
    color: var(--ds-surface);
}

.address-list-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    border: none;
}

.address-list-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 14px;
    color: var(--ds-text);
}

.address-list-table tbody tr:last-child td {
    border-bottom: none;
}

.address-list-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.address-list-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid var(--ds-border);
    background: white;
    color: var(--ds-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-small:hover {
    background: var(--ds-primary);
    color: white;
    border-color: var(--ds-primary);
}

.btn-small.btn-danger:hover {
    background: var(--ds-danger);
    border-color: var(--ds-danger);
}

/* CSV upload wrapper - now part of entry card */
.csv-upload-wrapper {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csv-upload-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-text);
    margin-bottom: 4px;
}

.csv-file-input {
    display: none;
}

.csv-choose-file-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--ds-primary);
    background: white;
    color: var(--ds-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--ds-font-family);
}

.csv-choose-file-btn:hover {
    background: var(--ds-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 115, 168, 0.3);
}

.csv-template-link-inline {
    color: var(--ds-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    margin-left: 12px;
}

.csv-template-link-inline:hover {
    color: var(--ds-primary);
    text-decoration: underline;
}

.csv-upload-message {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.csv-message-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.csv-message-close:hover {
    opacity: 1;
}

.csv-upload-message.success {
    background: var(--ds-success-bg);
    color: var(--ds-success);
    border: 1px solid var(--ds-success);
}

.csv-upload-message.error {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
    border: 1px solid var(--ds-danger);
}

.csv-upload-message.warning {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
    border: 1px solid var(--ds-warning);
}

/* Address list table header - blue background style */
.address-list-table-header {
    background: linear-gradient(135deg, #0073a8 0%, #005a87 100%);
    padding: 18px 24px;
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.address-list-header-content {
    flex: 1;
}

.address-list-table-title {
    font-size: 22px;
    font-weight: 600;
    color: white;
    margin: 0 0 8px 0;
}

.address-list-table-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.5;
}

/* Menu button and dropdown */
.address-list-menu-container {
    position: relative;
}

.address-list-menu-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: white;
    padding: 5px 9px;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-list-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.address-list-menu-btn .menu-icon {
    fill: white;
    display: block;
}

/* Empty table row */
.empty-row {
    background: #f9fafb;
}

.empty-message {
    text-align: center;
    padding: 40px 20px !important;
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

.address-list-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.address-list-menu-dropdown.show {
    display: block;
}

.menu-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: var(--ds-text);
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--ds-font-family);
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.menu-option:last-child {
    border-bottom: none;
}

.menu-option:hover {
    background: #f5f5f5;
}

.menu-option:active {
    background: #e8e8e8;
}

/* Duplicate address highlighting */
.address-row-duplicate {
    background-color: #fef3c7 !important;
    border-left: 3px solid #f59e0b;
}

.address-row-duplicate:hover {
    background-color: #fde68a !important;
}

.duplicate-label {
    color: #92400e;
    font-weight: 600;
    font-size: 12px;
    margin-left: 8px;
    padding: 2px 6px;
    background: #fbbf24;
    border-radius: 3px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 120px;
    padding: 22px 24px;
    border: 2px dashed var(--ds-primary);
    border-radius: 8px;
    background: var(--ds-surface);
    color: var(--ds-muted);
    user-select: none;
}

.file-dropzone:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--ds-focus);
}

.file-dropzone.is-dragover {
    background: #f0f7ff;
    border-color: var(--ds-primary);
}

.file-dropzone-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--ds-primary);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-primary);
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    position: relative;
}

.file-dropzone-icon-inner {
    display: none;
}

.file-dropzone-icon::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 16px;
    background: var(--ds-primary);
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 1px;
}

.file-dropzone-icon::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--ds-primary);
    border-top: 2px solid var(--ds-primary);
    top: 10px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.file-dropzone-text {
    font-size: 16px;
    color: var(--ds-muted);
}

.file-browse {
    color: var(--ds-primary);
    font-weight: 700;
    text-decoration: underline;
}

.file-helper {
    margin-top: 10px;
    color: var(--ds-muted);
    font-size: 13px;
}

.file-error {
    margin-top: 6px;
    color: var(--ds-danger);
    font-size: 12px;
}

.file-list {
    margin-top: 15px;
    padding: 0;
    list-style: none;
}

.file-item {
    background: #f8f9fa;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--ds-primary);
}

.file-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-item .file-name {
    color: #333;
    font-weight: 500;
}

.file-item .file-size {
    color: #666;
    font-size: 0.9em;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--ds-primary);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.file-remove:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--ds-focus);
}

.attachment-template-action {
    margin-bottom: 10px;
}

.attachment-template-link {
    color: var(--ds-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
}

.attachment-template-link:hover {
    color: var(--ds-primary-hover);
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 20px;
}

.form-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 156px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--ds-primary);
    background: #ffffff;
    color: var(--ds-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.form-action-btn:hover {
    background: #ffffff;
    color: var(--ds-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.18);
}

.form-actions-help {
    color: var(--ds-muted);
    font-size: 13px;
}

.submit-btn {
    width: 100%;
    background: var(--ds-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    text-transform: none;
    letter-spacing: 0;
}

.submit-btn:hover:not(:disabled) {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 115, 168, 0.22);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    display: none;
    position: relative;
}

/* Full-page friendly error state shown when no valid form can be resolved */
.form-error-page {
    text-align: center;
    padding: 48px 24px;
    margin: 40px auto;
    max-width: 480px;
    background: var(--ds-danger-bg);
    border: 1px solid rgba(180, 35, 24, 0.35);
    border-radius: 12px;
}
.form-error-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}
.form-error-page h2 {
    color: var(--ds-danger);
    margin: 0 0 8px;
}
.form-error-page p {
    color: var(--ds-text);
    margin: 0;
}

.status.success {
    background: var(--ds-success-bg);
    border: 1px solid rgba(6, 118, 71, 0.35);
    color: var(--ds-success);
}

.status.error {
    background: var(--ds-danger-bg);
    border: 1px solid rgba(180, 35, 24, 0.35);
    color: var(--ds-danger);
}

.status-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}

.status-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.08);
}

.status-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.pii-warning {
    background: var(--ds-warning-bg);
    border: 1px solid rgba(181, 71, 8, 0.35);
    color: var(--ds-warning);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}

.pii-warning h4 {
    margin-bottom: 10px;
    color: #856404;
}

.required {
    color: var(--ds-danger);
}

 .sr-only {
     position: absolute;
     width: 1px;
     height: 1px;
     padding: 0;
     margin: -1px;
     overflow: hidden;
     clip: rect(0, 0, 0, 0);
     white-space: nowrap;
     border: 0;
 }

@media (max-width: 1024px) and (min-width: 769px) {
    .form-row {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .header h1 {
        font-size: 22px;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.checkbox-group {
    padding: 4px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.checkbox-label-text {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: var(--ds-text);
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-label-text::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #b0b8c1;
    border-radius: 4px;
    background: #fff;
    margin-top: 1px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.checkbox-input:checked + .checkbox-label-text::before {
    background-color: var(--ds-primary);
    border-color: var(--ds-primary);
    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='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-repeat: no-repeat;
    background-position: center;
}

.checkbox-input:focus + .checkbox-label-text::before {
    box-shadow: 0 0 0 4px var(--ds-focus);
    border-color: var(--ds-primary);
}

.checkbox-group.has-error .checkbox-label-text::before {
    border-color: var(--ds-danger);
}

.dev-routing-preview {
    background: #eef2ff;
    border: 1.5px dashed #6366f1;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 8px;
}

.dev-routing-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: #4338ca;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.dev-routing-field {
    margin-bottom: 10px;
}

.dev-routing-field:last-child {
    margin-bottom: 0;
}

.dev-routing-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #a5b4fc;
    border-radius: 6px;
    background: #f0f4ff;
    color: #3730a3;
    font-size: 13px;
    cursor: default;
}
