/* ============================================
   SHARED GENERATOR STYLES - Co-Founder Equity Hub
   Consistent branding and mobile-responsive layout
   ============================================ */

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #8b5cf6;
    --accent: #10b981;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
}

/* Hub Header Bar */
.generator-header {
    background: #0f172a;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.generator-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.generator-header .back-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.generator-header .back-link:hover {
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
}

.generator-header .hub-link {
    color: #a78bfa;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.generator-header .hub-link:hover {
    color: #c4b5fd;
}

.generator-header .doc-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    padding-left: 12px;
    border-left: 1px solid #334155;
    margin-left: 4px;
}

.generator-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.generator-header .save-status {
    color: #64748b;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.generator-header .save-status.saved {
    color: #10b981;
}

/* Main Container - Two Column Layout */
.generator-container {
    display: grid;
    grid-template-columns: minmax(350px, 420px) 1fr;
    min-height: calc(100vh - 54px);
}

/* Form Panel */
.form-panel {
    background: white;
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 1px solid var(--gray-200);
    max-height: calc(100vh - 54px);
}

.form-panel h1 {
    font-size: 1.4rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.form-panel .subtitle {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Preview Panel */
.preview-panel {
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--gray-50);
    max-height: calc(100vh - 54px);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--gray-700);
    font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

/* Section Headers */
.section-header {
    font-weight: 700;
    color: var(--gray-800);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-header:first-of-type {
    margin-top: 0;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.15rem;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-weight: 500;
    margin-bottom: 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.checkbox-description {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 1.5rem;
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Info & Warning Boxes */
.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.info-box strong {
    color: #1e40af;
    display: block;
    margin-bottom: 0.25rem;
}

.warning-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.warning-box strong {
    color: #92400e;
    display: block;
    margin-bottom: 0.25rem;
}

.danger-box {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.danger-box strong {
    color: #991b1b;
    display: block;
    margin-bottom: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.download-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.25rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-group .btn {
    flex: 1;
}

/* Document Preview */
.document {
    background: white;
    max-width: 850px;
    margin: 0 auto;
    padding: 50px 65px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    line-height: 1.6;
    font-size: 11pt;
}

.document h1 {
    text-align: center;
    font-size: 14pt;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-900);
}

.document h2 {
    font-size: 11pt;
    margin: 1.25rem 0 0.5rem;
    text-transform: uppercase;
    color: var(--gray-800);
}

.document p {
    margin-bottom: 0.75rem;
    text-align: justify;
}

.document .centered {
    text-align: center;
}

.document .section-num {
    font-weight: bold;
}

/* Signature Blocks */
.signature-block {
    margin-top: 2.5rem;
    page-break-inside: avoid;
}

.signature-party {
    margin-bottom: 2rem;
}

.signature-line {
    border-top: 1px solid #333;
    width: 280px;
    margin-top: 2.5rem;
    padding-top: 0.25rem;
}

.signature-name {
    font-weight: bold;
}

/* Progress Indicator */
.form-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
}

.form-progress-step {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    transition: background 0.3s;
}

.form-progress-step.completed {
    background: var(--primary);
}

.form-progress-step.active {
    background: var(--primary-light);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .generator-container {
        grid-template-columns: 1fr;
    }

    .form-panel {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    .preview-panel {
        max-height: none;
        min-height: 60vh;
    }

    .document {
        padding: 30px 40px;
        margin: 0;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .generator-header {
        padding: 0 16px;
        height: auto;
        min-height: 54px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .generator-header-left {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .generator-header .doc-title {
        width: 100%;
        text-align: center;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: 6px;
        border-top: 1px solid #334155;
        margin-top: 6px;
    }

    .generator-header-right {
        display: none;
    }

    .form-panel {
        padding: 1rem;
    }

    .preview-panel {
        padding: 1rem;
    }

    .form-panel h1 {
        font-size: 1.25rem;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .document {
        padding: 20px 24px;
        font-size: 10pt;
    }

    .document h1 {
        font-size: 12pt;
    }

    .btn-group {
        flex-direction: column;
    }

    .signature-line {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-panel h1 {
        font-size: 1.1rem;
    }

    .form-panel .subtitle {
        font-size: 0.8rem;
    }

    .section-header {
        font-size: 0.8rem;
    }

    .form-group label {
        font-size: 0.75rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.65rem 0.75rem;
    }

    .info-box,
    .warning-box,
    .danger-box {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .download-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .generator-header,
    .form-panel,
    .download-btn,
    .btn-group {
        display: none !important;
    }

    .generator-container {
        display: block;
    }

    .preview-panel {
        padding: 0;
        background: white;
    }

    .document {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }

    .signature-block {
        page-break-inside: avoid;
    }
}
