/* ============================================
   NexgenTec Customer-Facing Pages — Shared Styles
   ============================================
   Loaded by templates/base.html on every customer page, BEFORE the
   per-page {% block extra_styles %} CSS. Pages can therefore override
   any rule here with an equal-specificity rule of their own.

   Canonical palette (GUI pass, June 2026): brand blue is #0078d4,
   success green is the #10b981 family, warning orange is the #f97316
   family. Don't introduce new greens/blues in page templates — use
   these tokens. */

:root {
    /* INTENTIONALLY different from admin's --accent-blue (#3b82f6,
       admin.css): each blue is AA-contrast on its own surfaces and fails
       on the other's. Do not unify. Decided 2026-06-10 (GUI pass wave 3). */
    --brand: #0078d4;
    --brand-dark: #005a9e;

    --ink: #1a1a2e;        /* headings */
    --ink-2: #1e293b;      /* strong body text */
    --muted: #64748b;      /* secondary text */
    --muted-2: #94a3b8;    /* faint text */

    --line: #e2e8f0;       /* borders */
    --line-soft: #f1f5f9;  /* hairline dividers */
    --surface-soft: #f8fafc;

    --green: #10b981;
    --green-deep: #059669;
    --green-ink: #065f46;
    --green-tint: #d1fae5;

    --blue-ink: #1d4ed8;
    --blue-tint: #dbeafe;

    --orange: #f97316;
    --orange-ink: #c2410c;
    --orange-deep: #9a3412;
    --orange-tint: #fff7ed;
    --orange-tint-2: #ffedd5;
}

/* ---------- Status-page chrome ----------
   Used by deal_status, deal_ms_status, project_status. */

.page-container {
    max-width: 640px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    color: var(--muted);
}

.status-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px;
    border-bottom: 1px solid var(--line-soft);
}

.company-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.deal-info {
    font-size: 14px;
    color: var(--muted-2);
}

.card-body {
    padding: 32px;
}

.card-footer {
    padding: 20px 32px;
    background: var(--surface-soft);
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.card-footer a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.card-footer a:hover {
    text-decoration: underline;
}

.progress-badge {
    background: var(--blue-tint);
    color: var(--blue-ink);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.progress-badge.complete {
    background: var(--green-tint);
    color: var(--green-ink);
}

.progress-badge.neutral {
    background: var(--line-soft);
    color: #475569;
}

.complete-message {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    color: #fff;
    margin-top: 24px;
}

.complete-message i {
    font-size: 48px;
    margin-bottom: 16px;
}

.complete-message h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.complete-message p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* ---------- Progress overview + steps list ----------
   Used by deal_ms_status and project_status. */

.progress-overview {
    margin-bottom: 32px;
}

.progress-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-overview-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.progress-overview-percent {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-ink);
}

.progress-bar-outer {
    height: 12px;
    background: var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--surface-soft);
    border-radius: 12px;
    border: 1px solid var(--line);
    transition: all 0.2s ease;
}

.step-item.completed,
.step-item.pre_existing {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.step-item.in_progress {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.step-item.waiting_on_customer {
    background: var(--orange-tint);
    border-color: #fed7aa;
}

.step-item.not_applicable {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.7;
}

.step-item.not_applicable .step-name {
    text-decoration: line-through;
    color: #9ca3af;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--line);
    color: var(--muted-2);
}

.step-icon i {
    font-size: 16px;
}

.step-item.completed .step-icon,
.step-item.pre_existing .step-icon {
    background: var(--green);
    color: #fff;
}

.step-item.in_progress .step-icon {
    background: #3b82f6;
    color: #fff;
}

.step-item.waiting_on_customer .step-icon {
    background: var(--orange);
    color: #fff;
}

.step-item.not_applicable .step-icon {
    background: #9ca3af;
    color: #fff;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.step-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-2);
}

.step-item.pending .step-name { color: var(--muted); }
.step-item.completed .step-name { color: var(--green-ink); }
.step-item.in_progress .step-name { color: var(--blue-ink); }

.step-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.step-badge.pending { background: var(--line-soft); color: var(--muted); }
.step-badge.in_progress { background: var(--blue-tint); color: var(--blue-ink); }
.step-badge.completed,
.step-badge.pre_existing { background: var(--green-tint); color: var(--green-ink); }
.step-badge.waiting_on_customer { background: var(--orange-tint-2); color: var(--orange-ink); }
.step-badge.not_applicable { background: #f3f4f6; color: #6b7280; }

.step-description {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.blocker-alert {
    background: var(--orange-tint);
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

.blocker-alert strong {
    color: var(--orange-ink);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blocker-alert p {
    color: var(--orange-deep);
    margin: 0;
    font-size: 14px;
}

.step-tasks-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.tasks-bar-outer {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    max-width: 120px;
}

.tasks-bar-inner {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.step-item.in_progress .tasks-bar-inner {
    background: #3b82f6;
}

/* ---------- Success / notice cards ----------
   Used by success, cancel, loa_success, estimate_success and the
   content_filtering confirmation pages. */

.success-page {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.success-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--green-tint);
    color: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
}

.success-icon.warn {
    background: var(--orange-tint);
    color: var(--orange);
}

.success-card h1 {
    color: var(--ink);
    font-size: 26px;
    margin-bottom: 16px;
}

.success-card h1.text-green { color: var(--green-deep); }
.success-card h1.text-warn { color: var(--orange-ink); }

.success-card .message {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Left-aligned "what happens next" box inside a success card */
.success-note-box {
    background: var(--surface-soft);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    margin-bottom: 24px;
}

.success-note-box h2 {
    font-size: 16px;
    color: var(--ink-2);
    margin-bottom: 16px;
}

.success-note-box ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.success-footnote {
    font-size: 14px;
    color: var(--muted);
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
}

.success-footnote a {
    color: var(--brand);
    text-decoration: none;
}

.success-footnote a:hover {
    text-decoration: underline;
}

/* Centered notice (no card) — invalid links, already-active states */
.notice-page {
    max-width: 500px;
    margin: 80px auto;
    text-align: center;
}

.notice-page .notice-icon {
    font-size: 56px;
    margin-bottom: 16px;
    color: var(--muted-2);
}

.notice-page .notice-icon.ok { color: var(--green); }

.notice-page h1 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--ink);
}

.notice-page p {
    color: var(--muted);
    font-size: 14px;
}

.notice-page a {
    color: var(--brand);
    text-decoration: none;
}

.notice-page a:hover {
    text-decoration: underline;
}

/* ---------- Buttons / links ---------- */

.btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-brand:hover {
    background: var(--brand-dark);
}

.link-brand {
    display: inline-block;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.link-brand:hover {
    text-decoration: underline;
}

/* ---------- Shared mobile adjustments (status pages) ---------- */

@media (max-width: 600px) {
    .page-header h1 {
        font-size: 24px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        padding: 20px 24px;
    }

    .card-body {
        padding: 24px;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .success-card {
        padding: 32px 24px;
    }
}

/* Flash messages on customer-facing pages (scheduling, etc.). */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
