:root {
    --accent-color: #ff6600;
    --accent-dark: #e05a00;
    --accent-light: #ff8533;
    --primary-color: #1e40af;
    --text-primary: #050505;
    --text-secondary: #333333;
    --text-tertiary: #666666;
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f0f0;
    --border-color: rgba(0, 0, 0, 0.12);
    --success: #48bb78;
    --success-dark: #2f855a;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.18);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #eef3fb 0%, #f6f8fb 100%);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 16px;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: var(--radius-sm);
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 16px;
}

.container {
    width: min(1100px, calc(100% - 2.5rem));
    margin: 0 auto;
}

.page-header {
    padding: var(--space-xl) 0 var(--space-lg);
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.85), rgba(17, 24, 39, 0.92));
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 60%);
    pointer-events: none;
}

.page-header h1 {
    font-size: clamp(2rem, 3vw, 2.75rem);
    margin: 0 0 0.75rem;
    letter-spacing: 0.01em;
}

.page-description {
    margin: 0 auto;
    max-width: 720px;
    font-size: 1.05rem;
    opacity: 0.92;
}

.intro-section {
    padding: var(--space-xl) 0;
}

.intro-content {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.intro-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 102, 0, 0.15);
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.intro-section h2 {
    margin-bottom: var(--space-sm);
    font-size: 2rem;
}

.intro-section p {
    color: var(--text-secondary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.benefit-item {
    background: #fff;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.benefit-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.benefit-icon {
    font-size: 1.75rem;
    color: var(--accent-color);
    margin-bottom: var(--space-xs);
}

.main-content {
    padding-bottom: var(--space-xl);
}

.generator-content {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg);
    margin-top: calc(var(--space-lg) * -0.75);
    position: relative;
    display: none;
}

.progress-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: var(--space-lg);
    padding-inline: var(--space-sm);
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 42px;
    right: 42px;
    height: 2px;
    background: var(--border-color);
}

.progress-step {
    position: relative;
    text-align: center;
}

.step-number {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all var(--transition-normal);
}

.progress-step.active .step-number {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.progress-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.step-label {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.progress-step.active .step-label {
    color: var(--accent-color);
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--accent-color);
    background: rgba(255, 102, 0, 0.08);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    margin-top: var(--space-md);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

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

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

.form-group label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-control {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-size: 1rem;
    transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 102, 0, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.18);
    background: #fff;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
    gap: var(--space-sm);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.info-note {
    background: rgba(255, 102, 0, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 0.85rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.photos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--space-sm);
}

.photo-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.photo-delete-btn:hover {
    opacity: 1;
}

.cover-preview {
    margin-top: var(--space-sm);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 320px;
}

.cover-preview img {
    width: 100%;
    display: block;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(1000px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    overflow: hidden;
}

.modal-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
    color: var(--accent-color);
}

#plan-preview-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: var(--space-md);
    background: #f5f7fb;
}

.report-preview {
    background: #fff;
    padding: 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.report-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1.5rem;
}

.report-preview h2 {
    color: var(--accent-color);
    font-size: 1.35rem;
    margin-top: 1.6rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.4rem;
}

.report-preview h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-top: 1.1rem;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.1rem;
}

.details-table th,
.details-table td {
    border: 1px solid #d1d5db;
    padding: 0.65rem 0.75rem;
    text-align: left;
}

.details-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    width: 25%;
}

.placeholder-text {
    color: #555;
    font-style: italic;
    background: rgba(255, 102, 0, 0.08);
    border-left: 3px solid var(--accent-color);
    padding: 0.1rem 0.4rem;
    display: inline-block;
}

.placeholder-section {
    background: rgba(255, 102, 0, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    margin: 0.75rem 0;
    font-style: italic;
}

.diagram-image {
    text-align: center;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
    background: #fff;
}

.diagram-image img {
    max-width: 100%;
    height: auto;
}

.footer {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 2rem;
    color: var(--text-tertiary);
}

.loading-indicator {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    gap: 0.75rem;
    z-index: 1200;
}

.loading-indicator i {
    font-size: 2rem;
    color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    .container {
        width: calc(100% - 1.5rem);
    }

    .generator-content {
        padding: var(--space-md);
    }

    .progress-indicator::before {
        left: 28px;
        right: 28px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.checkbox-label:hover {
    background: rgba(255, 102, 0, 0.05);
}

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

.rev-marker {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 102, 0, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.section {
    margin-bottom: 1.5rem;
}

.toc {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

.toc ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.toc a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.cover-page {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #1e40af 0%, #111827 100%);
    color: #fff;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.cover-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.cover-meta {
    margin-top: 1.5rem;
}

.cover-meta h1 {
    margin: 0 0 1rem;
    font-size: 2rem;
}

.page-break {
    page-break-after: always;
    break-after: page;
    margin: 2rem 0;
    border-top: 2px dashed #ccc;
    padding-top: 2rem;
}

@media (max-width: 540px) {
    .tabs {
        gap: 0.5rem;
    }

    .tab-btn {
        padding-inline: 0.9rem;
    }

    .progress-indicator {
        flex-direction: column;
        gap: 0.9rem;
        align-items: flex-start;
    }

    .progress-indicator::before {
        display: none;
    }

    .step-label {
        text-align: left;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

