/* ============================================
   STARTUP COUNSEL - SHARED STYLES
   Teal/Indigo theme for corporate governance tools
============================================ */
:root {
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-primary-light: #14b8a6;
    --color-accent: #6366f1;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-dark: #0f172a;
    --color-dark-mid: #1e293b;
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-border: #e2e8f0;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-family); line-height: 1.6; color: var(--color-text); background: var(--color-bg); }
* { touch-action: manipulation; }

/* ============================================
   NAV BAR - Startup Counsel branded
============================================ */
.sc-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.sc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}
.sc-brand:hover { opacity: 0.9; }
.sc-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.sc-links a {
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}
.sc-links a:hover { background: rgba(255, 255, 255, 0.25); }
.sc-links a.active { background: white; color: #0f766e; }
.sc-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}
.is-iframe .sc-nav { display: none !important; }

/* ============================================
   PAGE HEADER
============================================ */
.page-header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-mid) 50%, #312e81 100%);
    color: white;
    padding: 24px;
    text-align: center;
}
.page-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.page-header .subtitle { font-size: 16px; opacity: 0.9; margin-bottom: 12px; }
.header-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    opacity: 0.8;
}
.header-meta span, .header-meta a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

/* ============================================
   TOOL SECTION
============================================ */
.tool-section {
    background: var(--color-surface);
    padding: 32px 24px;
    border-bottom: 1px solid var(--color-border);
}
.tool-wrapper { max-width: 900px; margin: 0 auto; }

/* Form elements */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .form-grid { grid-template-columns: repeat(3, 1fr); } }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.help-text { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }

/* Checkbox/radio groups */
.check-group { display: flex; flex-direction: column; gap: 10px; }
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.check-item:hover { border-color: var(--color-primary); background: #f0fdfa; }
.check-item input { margin-top: 3px; accent-color: var(--color-primary); }
.check-item .check-label { font-size: 0.9rem; font-weight: 500; color: var(--color-text); }
.check-item .check-desc { font-size: 0.8rem; color: var(--color-text-secondary); margin-top: 2px; }

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #0d9488 0%, #6366f1 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
    transition: all 0.2s;
    min-height: 44px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4); }

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
    background: white;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-secondary:hover { background: #f0fdfa; }

/* Results */
.results-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    display: none;
}
.results-section.visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) { .results-grid { grid-template-columns: repeat(3, 1fr); } }

.result-card {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.result-card.highlight {
    background: linear-gradient(135deg, #0d9488 0%, #6366f1 100%);
    grid-column: span 2;
}
@media (min-width: 768px) { .result-card.highlight { grid-column: span 3; } }
.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
.result-card.highlight .result-label { color: rgba(255,255,255,0.8); }
.result-value { font-size: 1.5rem; font-weight: 700; color: var(--color-text); }
.result-card.highlight .result-value { color: #ffffff; font-size: 2rem; }

/* Score gauge */
.score-gauge {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    position: relative;
}
.score-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-gauge .bg { fill: none; stroke: var(--color-border); stroke-width: 12; }
.score-gauge .fill { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-text);
}
.score-label {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.score-good { color: var(--color-success); }
.score-warning { color: var(--color-warning); }
.score-danger { color: var(--color-danger); }

/* Detail list */
.detail-list { list-style: none; padding: 0; }
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}
.detail-item:last-child { border-bottom: none; }
.detail-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.detail-content { flex: 1; }
.detail-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.detail-desc { font-size: 0.8rem; color: var(--color-text-secondary); }
.detail-status { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 100px; margin-left: auto; flex-shrink: 0; }
.status-pass { background: #d1fae5; color: #065f46; }
.status-fail { background: #fee2e2; color: #991b1b; }
.status-warn { background: #fef3c7; color: #92400e; }
.status-info { background: #dbeafe; color: #1e40af; }

/* ============================================
   TABBED CONTENT SECTION
============================================ */
.content-tabs-section {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.content-tabs-nav {
    display: flex;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.content-tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 14px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}
.content-tab-btn:hover { background: var(--color-surface); color: var(--color-text); }
.content-tab-btn.active { background: var(--color-surface); color: var(--color-primary); border-bottom-color: var(--color-primary); }
.content-tab-panel { display: none; padding: 32px 24px; max-width: 900px; margin: 0 auto; }
.content-tab-panel.active { display: block; }
.content-tab-panel h2 { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.content-tab-panel h3 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; }
.content-tab-panel h3:first-of-type { margin-top: 0; }
.content-tab-panel p { line-height: 1.7; margin-bottom: 16px; }
.content-tab-panel ul, .content-tab-panel ol { margin: 16px 0; padding-left: 24px; }
.content-tab-panel li { margin-bottom: 8px; line-height: 1.6; }

/* FAQ within tab */
.faq-group-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--color-primary);
    margin: 0;
    padding: 10px 16px;
    border-radius: 0;
}
.faq-item {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.faq-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    gap: 16px;
}
.faq-trigger:hover { background: var(--color-bg); }
.faq-trigger h4 { font-size: 15px; font-weight: 500; margin: 0; flex: 1; }
.faq-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s;
    color: var(--color-text-secondary);
}
.faq-trigger[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 16px 16px; border-top: 1px solid var(--color-border); }
.faq-answer[hidden] { display: none; }
.faq-answer p { margin-top: 12px; font-size: 14px; line-height: 1.6; }

/* ============================================
   CONSULTATION / CTA
============================================ */
.consultation-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    padding: 48px 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.consultation-wrapper { max-width: 900px; margin: 0 auto; }
.consultation-section h2 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.consultation-section p { font-size: 16px; color: var(--color-text-secondary); margin-bottom: 24px; max-width: 600px; margin-left: auto; margin-right: auto; }
.calendly-inline-widget { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }

/* ============================================
   FOOTER
============================================ */
.page-footer {
    background: var(--color-dark);
    color: white;
    padding: 32px 24px;
    text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 13px; opacity: 0.6; }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .page-header { padding: 16px; }
    .page-header h1 { font-size: 22px; }
    .page-header .subtitle { font-size: 14px; }
    .header-meta { flex-direction: column; gap: 4px; font-size: 12px; }
    .tool-section { padding: 20px 16px; }
    .sc-nav { padding: 8px 12px; flex-direction: column; gap: 8px; }
    .sc-brand { font-size: 14px; }
    .sc-links { width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 6px; }
    .sc-links a { font-size: 11px; padding: 4px 8px; flex-shrink: 0; }
    .sc-divider { display: none; }
    .content-tab-btn { padding: 12px 14px; font-size: 12px; min-width: 80px; flex: 0 0 auto; }
    .content-tab-panel { padding: 20px 16px; }
    .consultation-section { padding: 32px 16px; }
    .consultation-section h2 { font-size: 22px; }
}
@media (max-width: 480px) {
    .page-header h1 { font-size: 20px; }
    .page-header .subtitle { font-size: 13px; }
    .content-tab-btn { padding: 10px 12px; font-size: 11px; min-width: 70px; }
}

/* ============================================
   AI CHAT INTERFACE (for GPT-5.2 tools)
============================================ */
.ai-chat-container {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
}
.ai-chat-header {
    background: linear-gradient(135deg, #0f766e 0%, #4f46e5 100%);
    padding: 14px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}
.ai-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
}
.ai-chat-messages {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ai-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.ai-msg.bot {
    background: var(--color-bg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.ai-msg.user {
    background: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}
.ai-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
}
.ai-chat-input input:focus { outline: none; border-color: var(--color-primary); }
.ai-chat-input button {
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.ai-chat-input button:hover { background: var(--color-primary-dark); }
.ai-upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 16px;
}
.ai-upload-zone:hover { border-color: var(--color-primary); background: #f0fdfa; }
.ai-upload-icon { font-size: 2.5rem; margin-bottom: 8px; }
.ai-upload-text { font-size: 0.9rem; color: var(--color-text-secondary); }
.ai-upload-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
