/* SCEA - Spartan Combat Exposure Artifact */
/* Clean, professional, military-adjacent styling */

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-card: #232b3d;
    --text-primary: #e8e8e8;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #c9a227;
    --accent-dim: #8b7019;
    --border: #374151;
    --success: #10b981;
    --letter-bg: #fefefe;
    --letter-text: #1a1a1a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
header {
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 2px solid var(--accent-dim);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

header .deployment {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Form Section */
.form-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.form-intro {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.form-intro p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

input[type="text"],
select,
textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Symptoms Section */
.symptoms-section {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.symptoms-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.section-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.symptom-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .symptom-grid {
        grid-template-columns: 1fr;
    }
}

.symptom-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.symptom-item:hover {
    background: #2a3447;
}

.symptom-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.symptom-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.symptom-item:has(input:checked) span {
    color: var(--text-primary);
}

/* Letter Section */
.letter-section {
    margin-bottom: 2rem;
}

.letter-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #ddb82e;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Letter Output */
.letter-output {
    background: var(--letter-bg);
    border-radius: 4px;
    padding: 2rem;
    color: var(--letter-text);
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.letter-content {
    max-width: 100%;
}

.letter-content h2 {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.letter-content .letter-subtitle {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    color: #444;
}

.letter-content .letter-meta {
    margin-bottom: 1.5rem;
}

.letter-content .letter-meta p {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.letter-content .letter-section-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.25rem;
}

.letter-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.letter-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
}

.letter-content li {
    margin-bottom: 0.35rem;
}

.letter-content .signature-block {
    margin-top: 2rem;
    padding-top: 1rem;
}

.letter-content .signature-line {
    border-bottom: 1px solid #333;
    width: 250px;
    margin-bottom: 0.25rem;
    height: 1.5rem;
}

.letter-content .signature-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Placeholder styling */
.letter-content .placeholder {
    background: #fff3cd;
    padding: 0 0.25rem;
    border-radius: 2px;
}

/* Footer */
footer {
    padding: 1.5rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.disclaimer {
    max-width: 600px;
    margin: 0 auto;
}

.disclaimer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.disclaimer .ccc-note {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(85, 107, 47, 0.15);
    border: 1px solid rgba(85, 107, 47, 0.3);
    border-radius: 4px;
}

.disclaimer .ccc-note p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.disclaimer .ccc-note a {
    color: var(--accent);
    text-decoration: none;
}

.disclaimer .ccc-note a:hover {
    text-decoration: underline;
}

.disclaimer .ccc-note .ein {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.disclaimer .legal-disclaimer {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.disclaimer .legal-disclaimer p {
    margin: 0;
}

.disclaimer .copyright {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* Mobile adjustments for corner toggle */
@media (max-width: 600px) {
    .pops-mode-toggle-corner {
        position: relative;
        top: auto;
        right: auto;
        margin: 0 auto 1rem;
        width: fit-content;
        opacity: 0.8;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .pops-hint {
        position: static;
        opacity: 0.7;
        transform: none;
        margin-top: 0;
        background: transparent;
        padding: 0;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    header,
    .form-section,
    .letter-controls,
    .pops-mode-toggle-corner,
    footer {
        display: none;
    }

    .letter-section {
        margin: 0;
    }

    .letter-output {
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    .letter-content {
        font-size: 12pt;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

/* Pops Mode Toggle - Corner Style */
.pops-mode-toggle-corner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(26, 42, 26, 0.7);
    border: 1px solid rgba(61, 92, 61, 0.5);
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.pops-mode-toggle-corner:hover {
    opacity: 1;
    background: rgba(26, 42, 26, 0.95);
}

.pops-mode-toggle-corner:hover .pops-hint {
    opacity: 1;
    transform: translateY(0);
}

.pops-hint {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-muted);
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.pops-mode-toggle-corner.unlocked .pops-hint {
    display: none;
}

.pops-mode-toggle-corner .pops-toggle-text {
    font-size: 0.8rem;
}

.pops-mode-toggle-corner .pops-toggle-slider {
    width: 36px;
    height: 20px;
    border-radius: 10px;
}

.pops-mode-toggle-corner .pops-toggle-slider::after {
    width: 14px;
    height: 14px;
}

.pops-mode-toggle-corner .pops-toggle-label input:checked + .pops-toggle-slider::after {
    transform: translateX(16px);
}

/* Container needs relative positioning for corner toggle */
.container {
    position: relative;
}

/* Legacy Pops Mode Toggle (in-form style, kept for reference) */
.pops-mode-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #1a2a1a 0%, #2a3a2a 100%);
    border: 1px solid #3d5c3d;
    border-radius: 8px;
}

.pops-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.pops-toggle-label input {
    display: none;
}

.pops-toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--bg-card);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.pops-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.pops-toggle-label input:checked + .pops-toggle-slider {
    background: #2d5a2d;
}

.pops-toggle-label input:checked + .pops-toggle-slider::after {
    transform: translateX(22px);
    background: #5cb85c;
}

.pops-toggle-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.pops-mode-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Pops Badge */
.pops-badge {
    display: inline-block;
    background: #5cb85c;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pops Mode Active State */
.pops-mode-active .form-section {
    border: 1px solid #3d5c3d;
}

.pops-mode-active header h1::after {
    content: ' (Pops Mode)';
    font-size: 0.6em;
    color: #5cb85c;
    font-weight: 400;
}

/* Collapsible Symptoms Section */
.symptoms-section h3 {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.symptoms-section h3::before {
    content: '▼';
    font-size: 0.7em;
    transition: transform 0.2s;
}

.symptoms-section.collapsed h3::before {
    transform: rotate(-90deg);
}

.symptoms-section.collapsed .section-note,
.symptoms-section.collapsed .symptom-grid {
    display: none;
}

.symptoms-section.collapsed h3::after {
    content: ' (all checked — click to expand)';
    font-size: 0.75em;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
