/* OSINT Navigator — Community Survey */

:root {
    --gold: #ECBB2D;
    --gold-soft: rgba(236, 187, 45, 0.12);
    --gold-border: rgba(236, 187, 45, 0.35);
    --blue: #2451C9;
    --blue-deep: #1a3d9e;
    --bg: #FDFCF9;
    --bg-card: #FFFFFF;
    --text: #374151;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --border: rgba(55, 65, 81, 0.08);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-hover: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
    --error: #dc2626;
    --error-bg: #fef2f2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Subtle paper texture overlay — matches main app */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 1000;
}


/* ============================================
   Container
   ============================================ */

.survey-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
    min-height: 100vh;
}


/* ============================================
   Header
   ============================================ */

.survey-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-mark::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 4px;
}

.logo-mark::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.logo-text {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--blue);
}

.survey-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
    background: var(--gold-soft);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--gold-border);
    white-space: nowrap;
}


/* ============================================
   Progress Bar
   ============================================ */

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.step-indicator {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 32px;
}


/* ============================================
   Steps
   ============================================ */

.step {
    animation: fadeIn 0.3s ease;
}

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

.step-header {
    margin-bottom: 32px;
}

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.step-subtitle {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}


/* ============================================
   Form Elements
   ============================================ */

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-select:focus,
.form-textarea:focus {
    border-color: var(--gold-border);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 80px;
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select::placeholder {
    color: var(--text-muted);
}


/* ============================================
   Category Grid
   ============================================ */

.category-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.category-btn {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-btn:hover {
    border-color: var(--gold-border);
    color: var(--text);
}

.category-btn.active {
    background: var(--gold-soft);
    border-color: var(--gold-border);
    color: #92700d;
    font-weight: 600;
}

.category-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.category-btn.disabled:hover {
    border-color: var(--border);
    color: var(--text-light);
}


/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--gold);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
    background: #d4a41f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 187, 45, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: var(--blue);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    text-decoration: underline;
}

.step-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* ============================================
   Question Cards (Step 2)
   ============================================ */

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.question-number {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(55, 65, 81, 0.06);
    padding: 4px 10px;
    border-radius: 100px;
}

.question-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold);
    background: var(--gold-soft);
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--gold-border);
}

.question-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 16px;
}

.question-card .form-group {
    margin-bottom: 16px;
}

.question-card .form-group:last-child {
    margin-bottom: 0;
}

.question-card .form-group label {
    font-size: 13px;
    color: var(--text-light);
}

/* Answer Textarea */
.answer-text {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
    line-height: 1.6;
    min-height: 100px;
}

.answer-text:focus {
    border-color: var(--gold-border);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.answer-text::placeholder {
    color: var(--text-muted);
}

/* Confidence Scale */
.confidence-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 4px;
    white-space: nowrap;
}

.confidence-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confidence-btn:hover {
    border-color: rgba(36, 81, 201, 0.3);
    color: var(--blue);
}

.confidence-btn.selected {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}

/* Confidence Labels */
.confidence-labels {
    display: flex;
    justify-content: space-between;
    max-width: 220px;
    margin-top: 4px;
}

.confidence-labels span {
    font-size: 11px;
    color: var(--text-muted);
}

/* Clarity Toggle */
.clarity-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clarity-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clarity-btn:hover {
    border-color: rgba(55, 65, 81, 0.2);
    color: var(--text);
}

.clarity-btn.selected {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}


/* ============================================
   Optional Badge
   ============================================ */

.optional-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(55, 65, 81, 0.06);
    padding: 3px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}


/* ============================================
   Thank You (Step 3)
   ============================================ */

.thank-you {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 0;
}

.thank-you-icon {
    margin-bottom: 24px;
}

.thank-you-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.thank-you-contributor {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.thank-you-contributor strong {
    color: var(--blue);
    font-weight: 700;
}

.thank-you-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 440px;
    margin-bottom: 32px;
}

.thank-you-cta {
    width: auto;
    padding: 12px 32px;
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .survey-container {
        padding: 24px 16px;
    }

    .survey-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .step-title {
        font-size: 20px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-btn {
        font-size: 12px;
        padding: 8px 10px;
    }

    .confidence-group {
        gap: 6px;
    }

    .confidence-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .question-card {
        padding: 20px 16px;
    }

    .thank-you {
        padding: 32px 0;
    }

    .thank-you-title {
        font-size: 24px;
    }
}
