/* ============================================
   Page Specific Styles - GitHub Primer Light Theme
   ============================================ */

/* === Page Wrapper === */
.gh-page-wrap {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: calc(var(--header-height) + var(--space-5)) var(--space-3) var(--space-5);
}

.gh-page-wrap--narrow {
    max-width: var(--container-narrow);
}

.gh-page-wrap--wide {
    max-width: var(--container-wide);
}

.gh-page-wrap--guide {
    padding: calc(var(--header-height) + var(--space-4)) var(--space-3) var(--space-4);
}

/* === Auth Layout (Login/Signup) === */
.gh-auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 200px);
    padding: calc(var(--header-height) + var(--space-5)) var(--space-3) var(--space-5);
    background: var(--color-canvas-subtle);
}

.gh-auth-shell {
    display: flex;
    gap: var(--space-6);
    width: 100%;
    max-width: 900px;
    align-items: stretch;
}

.gh-auth-left {
    flex: 1;
    min-width: 0;
}

.gh-auth-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.gh-auth-card {
    width: 100%;
    max-width: 400px;
    padding: var(--space-4);
}

.gh-auth-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-light);
    text-align: center;
    margin-bottom: var(--space-4);
    color: var(--color-fg-default);
}

.gh-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.gh-auth-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
    border-top: 1px solid var(--color-border-default);
}

/* Promo Banner */
.gh-promo {
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--color-success-subtle) 0%, var(--color-accent-subtle) 100%);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
}

.gh-promo-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: var(--space-4);
    line-height: var(--leading-snug);
}

.gh-promo-title span {
    color: var(--color-success-fg);
}

.gh-promo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.gh-promo-list li {
    font-size: var(--text-sm);
    color: var(--color-fg-default);
    padding-left: var(--space-4);
    position: relative;
}

.gh-promo-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success-fg);
    font-weight: var(--font-semibold);
}

/* === Guide/Manual Page === */
.gh-guide-card {
    background: var(--color-canvas-default);
    padding: var(--space-5);
}

.gh-guide-header {
    text-align: center;
    margin-bottom: var(--space-5);
}

.gh-guide-kicker {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-success-fg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.gh-guide-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: var(--space-2);
}

.gh-guide-desc {
    font-size: var(--text-base);
    color: var(--color-fg-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Summary Grid */
.gh-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.gh-summary-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
}

.gh-summary-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success-subtle);
    color: var(--color-success-fg);
    border-radius: var(--radius-full);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.gh-summary-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: 2px;
}

.gh-summary-desc {
    font-size: var(--text-xs);
    color: var(--color-fg-muted);
}

/* Guide CTA */
.gh-guide-cta {
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

/* Services Section */
.gh-services {
    margin-bottom: var(--space-5);
}

.gh-section-header {
    margin-bottom: var(--space-4);
}

.gh-section-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: var(--space-1);
}

.gh-section-desc {
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
}

.gh-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3);
}

.gh-service-card {
    display: flex;
    flex-direction: column;
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gh-service-top {
    padding: var(--space-3);
    flex: 1;
}

.gh-service-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin: var(--space-2) 0;
}

.gh-service-desc {
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
    line-height: var(--leading-normal);
}

.gh-service-actions {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-canvas-subtle);
    border-top: 1px solid var(--color-border-default);
}

/* Info Grid */
.gh-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

/* Panel */
.gh-panel {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.gh-panel-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: var(--space-3);
}

.gh-panel-subtitle {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin: var(--space-3) 0 var(--space-2);
}

.gh-panel-desc {
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
    margin-bottom: var(--space-3);
}

.gh-panel-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-default);
    font-size: var(--text-sm);
}

.gh-dot {
    color: var(--color-fg-muted);
    margin: 0 var(--space-2);
}

/* List */
.gh-list {
    list-style: none;
}

.gh-list li {
    font-size: var(--text-sm);
    color: var(--color-fg-default);
    padding: var(--space-2) 0;
    padding-left: var(--space-4);
    position: relative;
}

.gh-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-success-fg);
}

/* Steps */
.gh-steps {
    list-style: none;
    counter-reset: step-counter;
}

.gh-steps li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-fg-default);
}

.gh-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-fg-onEmphasis);
    background: var(--color-success-emphasis);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* FAQ Section */
.gh-faq-section {
    margin-top: var(--space-4);
}

.gh-faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.gh-faq-item {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gh-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-align: left;
    cursor: pointer;
    background: var(--color-canvas-subtle);
    border: none;
    color: var(--color-fg-default);
    transition: background-color 80ms;
}

.gh-faq-question:hover {
    background: var(--color-neutral-subtle);
}

.gh-faq-question::after {
    content: "+";
    font-size: var(--text-lg);
    color: var(--color-fg-muted);
    transition: transform 150ms;
}

.gh-faq-item[open] .gh-faq-question::after {
    content: "−";
}

.gh-faq-answer {
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
    line-height: var(--leading-relaxed);
    border-top: 1px solid var(--color-border-default);
}

/* CTA Banner */
.gh-cta-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--color-success-emphasis) 0%, #1a7f37 100%);
    border-radius: var(--radius-lg);
    margin-top: var(--space-5);
}

.gh-cta-banner-text {
    color: var(--color-fg-onEmphasis);
}

.gh-cta-banner-small {
    font-size: var(--text-sm);
    opacity: 0.9;
    margin-bottom: var(--space-1);
}

.gh-cta-banner-big {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

.gh-cta-banner-actions {
    display: flex;
    gap: var(--space-2);
}

/* === Dashboard Page === */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.stat-card {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}

.stat-card-title {
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
    margin-bottom: var(--space-2);
}

.stat-card-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-fg-default);
}

.stat-card-change {
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

.stat-card-change.positive { color: var(--color-success-fg); }
.stat-card-change.negative { color: var(--color-danger-fg); }

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-default);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-canvas-subtle);
    color: var(--color-fg-muted);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: var(--text-sm);
    color: var(--color-fg-default);
    margin-bottom: 2px;
}

.activity-meta {
    font-size: var(--text-xs);
    color: var(--color-fg-subtle);
}

/* === Legal Pages (Privacy, Terms) === */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-3);
}

.legal-content h1 {
    font-size: var(--text-3xl);
    color: var(--color-fg-default);
    margin-bottom: var(--space-5);
}

.legal-content h2 {
    font-size: var(--text-xl);
    color: var(--color-fg-default);
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-default);
}

.legal-content h3 {
    font-size: var(--text-lg);
    color: var(--color-fg-default);
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
}

.legal-content p {
    color: var(--color-fg-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
}

.legal-content ul {
    list-style: disc;
    padding-left: var(--space-4);
    margin-bottom: var(--space-3);
}

.legal-content li {
    color: var(--color-fg-muted);
    margin-bottom: var(--space-2);
}

.legal-updated {
    font-size: var(--text-sm);
    color: var(--color-fg-subtle);
    margin-bottom: var(--space-4);
}

/* === Grid Layouts === */
.grid {
    display: grid;
    gap: var(--space-3);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: var(--space-5);
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
}

.feature-icon--accent {
    background: var(--color-accent-subtle);
    color: var(--color-accent-fg);
}

.feature-icon--success {
    background: var(--color-success-subtle);
    color: var(--color-success-fg);
}

.feature-icon--done {
    background: var(--color-done-subtle);
    color: var(--color-done-fg);
}

.feature-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-fg-default);
    margin-bottom: var(--space-2);
}

.feature-description {
    font-size: var(--text-sm);
    color: var(--color-fg-muted);
}

/* === Responsive === */
@media (max-width: 768px) {
    .gh-auth-shell {
        flex-direction: column;
    }

    .gh-auth-right {
        display: none;
    }

    .gh-guide-cta {
        display: flex;
    }

    .gh-cta-banner {
        flex-direction: column;
        text-align: center;
    }

    .gh-cta-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .gh-cta-banner-actions .gh-btn {
        width: 100%;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .gh-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gh-page-wrap {
        padding: calc(var(--header-height) + var(--space-3)) var(--space-2) var(--space-3);
    }

    .gh-guide-title {
        font-size: var(--text-2xl);
    }

    .gh-summary-grid {
        grid-template-columns: 1fr;
    }

    .gh-service-grid {
        grid-template-columns: 1fr;
    }
}
