/* ── Modal Hint Toggles ── */
.hint-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 12px;
    cursor: pointer;
    padding: 3px 0;
    margin-top: 4px;
    display: inline-block;
    text-decoration: underline dotted;
}

.hint-toggle:hover {
    color: #343a40;
}

.hint-box {
    display: none;
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #333;
}

.hint-box.visible {
    display: block;
}

.hint-box ul {
    margin: 0;
    padding-left: 16px;
}

.hint-box ul li {
    margin-bottom: 3px;
    line-height: 1.4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* ── Top Nav ── */
.top-nav {
    background: #ffffff;
    color: #1a1a2e;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 200;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.top-nav-brand {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.3px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo {
    height: 60px;
    width: auto;
    vertical-align: middle;
}

.top-nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    background: #f0f4ff;
    border: 1px solid #c5d0e8;
    color: #1a1a2e;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.nav-link:hover {
    background: #dce6ff;
}

.container {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
    gap: 10px;
    padding: 10px;
}

.modal-wide {
    width: 780px;
}

/* ── Left Panel ── */
.instructions-panel {
    flex: 0 0 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ── Step Tracker ── */
.step-tracker {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #aaa;
    text-align: center;
    min-width: 60px;
}

.step.active {
    color: #007bff;
    font-weight: bold;
}

.step.completed {
    color: #28a745;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.step.active .step-number {
    background: #007bff;
    color: white;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step-divider {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 4px;
    margin-bottom: 16px;
}

.step-divider.completed {
    background: #28a745;
}

/* ── Card ── */
.instructions-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    flex: 1;
}

.card-content {
    display: none;
}

.card-content.active {
    display: block;
}

.instructions-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 22px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.instructions-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ── Field Errors ── */
.field-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* ── Form ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.topics-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    margin-top: 20px;
}

.checkbox-group {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    user-select: none;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.checkbox-item:hover {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.checkbox-item:has(input:checked) {
    border-color: #007bff;
    background-color: #e8f0fe;
    box-shadow: 0 0 0 1px #007bff;
    color: #0056b3;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 0;
    transform: scale(1.2);
    flex-shrink: 0;
    accent-color: #007bff;
    cursor: pointer;
}

/* ── Instruction Steps (Q items) ── */
.q-item {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.q-item .q-label {
    font-weight: bold;
    color: #007bff;
    font-size: 13px;
    margin-bottom: 6px;
}

.q-item .q-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}

.q-item .q-note {
    color: #888;
    font-size: 12px;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 0;
}

.q-item .q-tip {
    display: block;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

.q-item .q-tip strong {
    white-space: normal;
}

/* ── Next Button ── */
.next-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 11px 28px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 25px;
    transition: background-color 0.2s;
}

.next-button:hover {
    background-color: #0056b3;
}

.next-button:active {
    background-color: #004085;
}

.next-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* ── Loading Spinner ── */
.loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 28px;
    width: 680px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.modal h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 18px;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 10px;
}

.modal .form-group label {
    font-size: 13px;
}

.modal .form-group textarea,
.modal .form-group input[type="text"],
.modal .form-group input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-danger:hover { background: #b02a37; }

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover { background: #565e64; }

.add-incident-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 12px;
}

.add-incident-btn:hover { background: #b02a37; }

/* ── Copy Buttons ── */
.copy-btn {
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.15s, background-color 0.15s;
}

.copy-btn:hover {
    filter: brightness(0.85);
}

.copy-btn-blue {
    padding: 6px 16px;
    font-size: 13px;
    background: #007bff;
}

.copy-btn-amber {
    margin-left: 10px;
    padding: 3px 10px;
    font-size: 12px;
    background: #856404;
}

.copy-feedback {
    color: #dc3545;
    font-size: 12px;
    font-weight: bold;
    transition: opacity 2s ease;
    display: inline-block;
}

/* ── Back Button ── */
.back-button {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 11px 22px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 25px;
    margin-right: 10px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background: #ced4da;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
}

/* ── Submit Warning ── */
.submit-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 16px 18px;
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.submit-warning .warn-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.submit-warning .warn-text {
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

.submit-warning .warn-text strong:first-child {
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

/* ── Right Panel ── */
.website-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.website-header {
    background: #007bff;
    color: white;
    padding: 0 15px;
    font-weight: bold;
    font-size: 14px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.cant-see-link {
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    font-size: 12px;
    font-weight: normal;
    padding: 3px 10px 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.15s;
}

.cant-see-link:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

.cant-see-link .help-icon {
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.5);
    color: #007bff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
}

.cant-see-dropdown {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 14px 16px;
    z-index: 100;
    min-width: 280px;
    font-weight: normal;
    font-size: 13px;
    color: #333;
}

.cant-see-dropdown.visible {
    display: block;
}

.cant-see-dropdown p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.website-iframe {
    width: 100%;
    height: calc(100% - 45px);
    border: none;
    display: block;
}

.open-tab-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s;
    display: none;
}

.open-tab-btn.visible {
    display: inline-block;
}

.open-tab-btn:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 5px;
    }
    .instructions-panel {
        flex: 0 0 auto;
    }
    .website-panel {
        flex: 1;
        min-height: 400px;
    }
}