/**
 * Philanthropy Planner — Design System
 *
 * Polished, professional design for HNW philanthropists.
 * Two-font system: Playfair Display (headings) + DM Sans (body).
 * Palette: deep slate, warm gold, clean whites.
 */

/* ================================================================
   CSS Variables
   ================================================================ */

:root {
    /* Primary palette */
    --pp-slate:        #1e293b;
    --pp-slate-light:  #334155;
    --pp-slate-dark:   #0f172a;

    /* Accent — warm gold */
    --pp-gold:         #b8860b;
    --pp-gold-light:   #d4a843;
    --pp-gold-soft:    #f5e6c4;
    --pp-gold-bg:      #fdf8ef;

    /* Neutral tones */
    --pp-white:        #ffffff;
    --pp-cream:        #faf9f6;
    --pp-gray-50:      #f8fafc;
    --pp-gray-100:     #f1f5f9;
    --pp-gray-200:     #e2e8f0;
    --pp-gray-300:     #cbd5e1;
    --pp-gray-400:     #94a3b8;
    --pp-gray-500:     #64748b;
    --pp-gray-600:     #475569;
    --pp-gray-700:     #334155;
    --pp-gray-800:     #1e293b;
    --pp-gray-900:     #0f172a;

    /* Text */
    --pp-text:         #1e293b;
    --pp-text-muted:   #64748b;
    --pp-text-light:   #94a3b8;

    /* Semantic */
    --pp-success:      #059669;
    --pp-success-bg:   #ecfdf5;
    --pp-error:        #dc2626;
    --pp-error-bg:     #fef2f2;
    --pp-info:         #2563eb;
    --pp-info-bg:      #eff6ff;

    /* Typography */
    --pp-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --pp-font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing scale */
    --pp-space-xs:     4px;
    --pp-space-sm:     8px;
    --pp-space-md:     16px;
    --pp-space-lg:     24px;
    --pp-space-xl:     40px;
    --pp-space-2xl:    64px;
    --pp-space-3xl:    96px;

    /* Borders & shadows */
    --pp-radius-sm:    6px;
    --pp-radius-md:    10px;
    --pp-radius-lg:    16px;
    --pp-radius-xl:    24px;
    --pp-shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
    --pp-shadow-md:    0 4px 16px rgba(0,0,0,0.08);
    --pp-shadow-lg:    0 8px 32px rgba(0,0,0,0.1);
    --pp-shadow-xl:    0 16px 48px rgba(0,0,0,0.12);

    /* Transitions */
    --pp-ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --pp-duration:     0.25s;
}

/* ================================================================
   Reset & Base
   ================================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--pp-font-body);
    color: var(--pp-text);
    background: var(--pp-cream);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   Typography
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--pp-font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--pp-slate);
}

h1 { font-size: 2.75rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem;    letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem;    font-weight: 600; }

p {
    color: var(--pp-gray-600);
    line-height: 1.7;
}

a {
    color: var(--pp-gold);
    text-decoration: none;
    transition: color var(--pp-duration) var(--pp-ease);
}
a:hover {
    color: var(--pp-gold-light);
}

.text-muted  { color: var(--pp-text-muted); }
.text-center { text-align: center; }
.text-sm     { font-size: 0.875rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }

/* ================================================================
   Layout
   ================================================================ */

.pp-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--pp-space-lg);
}

.pp-container-narrow {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--pp-space-lg);
}

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

.pp-flex {
    display: flex;
    gap: var(--pp-space-lg);
}

.pp-grid {
    display: grid;
    gap: var(--pp-space-lg);
}

.pp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pp-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ================================================================
   Navigation
   ================================================================ */

.pp-nav {
    background: var(--pp-slate-dark);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pp-nav-brand {
    font-family: var(--pp-font-heading);
    color: var(--pp-gold-light) !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
}
.pp-nav-brand:hover { color: var(--pp-gold) !important; }

.pp-nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pp-nav-links a {
    color: var(--pp-gray-300);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    transition: color var(--pp-duration) var(--pp-ease);
}
.pp-nav-links a:hover { color: var(--pp-white); }

.pp-nav-links .pp-nav-cta {
    background: var(--pp-gold);
    color: var(--pp-white) !important;
    padding: 8px 18px;
    border-radius: var(--pp-radius-sm);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pp-nav-links .pp-nav-cta:hover {
    background: var(--pp-gold-light);
}
.pp-nav-links .pp-nav-user {
    color: var(--pp-gold-light, #c9a84c) !important;
    font-size: 0.9rem;
}

/* ================================================================
   Buttons
   ================================================================ */

.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--pp-radius-sm);
    font-family: var(--pp-font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pp-duration) var(--pp-ease);
    text-decoration: none;
    line-height: 1.4;
}

.pp-btn-primary {
    background: var(--pp-gold);
    color: var(--pp-white);
}
.pp-btn-primary:hover {
    background: var(--pp-gold-light);
    color: var(--pp-white);
    transform: translateY(-1px);
    box-shadow: var(--pp-shadow-md);
}

.pp-btn-secondary {
    background: var(--pp-slate);
    color: var(--pp-white);
}
.pp-btn-secondary:hover {
    background: var(--pp-slate-light);
    color: var(--pp-white);
}

.pp-btn-ghost {
    background: transparent;
    color: var(--pp-slate);
    border: 2px solid var(--pp-gray-300);
}
.pp-btn-ghost:hover {
    border-color: var(--pp-slate);
    color: var(--pp-slate);
}

.pp-btn-lg {
    padding: 16px 36px;
    font-size: 17px;
    border-radius: var(--pp-radius-md);
}

.pp-btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.pp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================================================
   Cards
   ================================================================ */

.pp-card {
    background: var(--pp-white);
    border-radius: var(--pp-radius-lg);
    padding: var(--pp-space-xl);
    box-shadow: var(--pp-shadow-sm);
    transition: box-shadow var(--pp-duration) var(--pp-ease),
                transform var(--pp-duration) var(--pp-ease);
}

.pp-card:hover {
    box-shadow: var(--pp-shadow-md);
}

.pp-card-selectable {
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.pp-card-selectable:hover {
    border-color: var(--pp-gray-200);
    transform: translateY(-2px);
    box-shadow: var(--pp-shadow-lg);
}

.pp-card-selectable.selected {
    border-color: var(--pp-gold);
    background: var(--pp-gold-bg);
    box-shadow: 0 0 0 1px var(--pp-gold), var(--pp-shadow-md);
}

.pp-card-selectable.selected::after {
    content: '\2713';
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    background: var(--pp-gold);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* ================================================================
   Form Inputs
   ================================================================ */

.pp-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--pp-gray-200);
    border-radius: var(--pp-radius-sm);
    font-family: var(--pp-font-body);
    font-size: 15px;
    color: var(--pp-text);
    background: var(--pp-white);
    outline: none;
    transition: border-color var(--pp-duration) var(--pp-ease),
                box-shadow var(--pp-duration) var(--pp-ease);
}

.pp-input:focus {
    border-color: var(--pp-gold);
    box-shadow: 0 0 0 3px var(--pp-gold-soft);
}

.pp-input::placeholder {
    color: var(--pp-gray-400);
}

.pp-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-gray-700);
    margin-bottom: 6px;
}

.pp-form-group {
    margin-bottom: 20px;
}

.pp-form-error {
    color: var(--pp-error);
    font-size: 13px;
    margin-top: 4px;
}

/* ================================================================
   Alerts / Feedback
   ================================================================ */

.pp-alert {
    padding: 14px 20px;
    border-radius: var(--pp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.pp-alert.show { display: block; }

.pp-alert-error {
    background: var(--pp-error-bg);
    color: var(--pp-error);
    border: 1px solid #fecaca;
}

.pp-alert-success {
    background: var(--pp-success-bg);
    color: var(--pp-success);
    border: 1px solid #a7f3d0;
}

.pp-alert-info {
    background: var(--pp-info-bg);
    color: var(--pp-info);
    border: 1px solid #bfdbfe;
}

/* ================================================================
   Progress Bar (Journey)
   ================================================================ */

.pp-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: var(--pp-space-xl);
}

.pp-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding-bottom: 28px;
}

.pp-progress-step::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--pp-gray-200);
}

.pp-progress-step::after {
    content: attr(data-step);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--pp-gray-200);
    color: var(--pp-gray-500);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pp-progress-step.active::after {
    background: var(--pp-gold);
    color: white;
}

.pp-progress-step.completed::before {
    background: var(--pp-gold);
}

.pp-progress-step.completed::after {
    background: var(--pp-gold);
    color: white;
    content: '\2713';
}

.pp-progress-label {
    font-size: 12px;
    color: var(--pp-gray-500);
    font-weight: 500;
}

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

/* ================================================================
   Footer
   ================================================================ */

.pp-footer {
    background: var(--pp-slate-dark);
    color: var(--pp-gray-400);
    padding: var(--pp-space-xl) 0;
    margin-top: auto;
    font-size: 14px;
}

.pp-footer a {
    color: var(--pp-gray-300);
}
.pp-footer a:hover {
    color: var(--pp-white);
}

/* ================================================================
   Toast
   ================================================================ */

.pp-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: var(--pp-radius-md);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--pp-shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 2000;
}
.pp-toast.show { opacity: 1; transform: translateY(0); }
.pp-toast.success { background: var(--pp-success); }
.pp-toast.error { background: var(--pp-error); }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1200px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .pp-grid-2, .pp-grid-3, .pp-grid-4 {
        grid-template-columns: 1fr;
    }

    .pp-container, .pp-container-narrow {
        padding: 0 var(--pp-space-md);
    }

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

    .pp-btn-lg {
        padding: 14px 28px;
        font-size: 15px;
    }

    .pp-nav {
        padding: 12px 16px;
    }

    .pp-card {
        padding: var(--pp-space-lg);
    }
}