/* ============================================================
   dedication.css  —  Tree of Lights / Dedicate a Light
   Matches the full prototype UI exactly
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,800;1,700&family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg: #f7f5f1;
    --surface: #ffffff;
    --surface-soft: #faf8f4;
    --border: #e5dfd5;
    --text: #171717;
    --muted: #66635e;
    --brand: #0e5a88;
    --brand-dark: #0a4568;
    --error: #b84040;
    --shadow: 0 12px 30px rgba(0,0,0,0.08);
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 10px;
    /* Light colours */
    --light-white: #efefea;
    --light-red: #e84a4a;
    --light-green: #2d8a6a;
    --light-blue: #1b79c9;
    --light-gold: #c9971d;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    background: linear-gradient(180deg, #fbfaf8 0%, var(--bg) 100%);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, p {
    margin: 0;
}

/* ── Page Wrapper ───────────────────────────────────────────── */
.dedication-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* ── Panel (white card) ─────────────────────────────────────── */
.ded-panel {
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

/* ── Header Panel ───────────────────────────────────────────── */
.ded-header {
    padding: 28px 36px 24px;
}

.ded-eyebrow {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(14,90,136,0.08);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.ded-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(44px, 7vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text);
}

.ded-header p {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

/* ── Section inside panel ───────────────────────────────────── */
.ded-section {
    padding: 28px 32px;
}

.ded-section-header {
    margin-bottom: 26px;
}

    .ded-section-header h2 {
        font-family: 'Playfair Display', Georgia, serif;
        font-size: clamp(28px, 4vw, 38px);
        letter-spacing: -0.02em;
        margin-bottom: 8px;
        color: var(--text);
    }

    .ded-section-header p {
        color: var(--muted);
        font-size: 15px;
        line-height: 1.6;
        max-width: 720px;
    }

/* ── Tribute Card ───────────────────────────────────────────── */
.tribute-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    background: #fcfbfa;
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
}

    .tribute-card:last-of-type {
        margin-bottom: 0;
    }

.tribute-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

    .tribute-card-title h3 {
        font-family: 'Playfair Display', Georgia, serif;
        font-size: 26px;
        letter-spacing: -0.02em;
        color: var(--text);
    }

/* selected light badge */
.selected-light-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: white;
    border: 1px solid #e6dfd6;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark);
}

.badge-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

    .badge-dot.color-white {
        background: var(--light-white);
    }

    .badge-dot.color-red {
        background: var(--light-red);
    }

    .badge-dot.color-green {
        background: var(--light-green);
    }

    .badge-dot.color-blue {
        background: var(--light-blue);
    }

    .badge-dot.color-gold {
        background: var(--light-gold);
    }

/* ── Form Grid ──────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 20px;
}

    .form-grid .field-full {
        grid-column: 1 / -1;
    }

/* ── Field ──────────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .field label,
    .field .field-label {
        font-size: 14px;
        font-weight: 800;
        color: var(--text);
        letter-spacing: 0.01em;
    }

    .field .field-hint {
        font-size: 13px;
        color: var(--muted);
        line-height: 1.5;
        margin-top: -2px;
    }

.field-validation-error {
    font-size: 13px;
    font-weight: 700;
    color: var(--error);
    line-height: 1.4;
}

/* ── Inputs & Selects ───────────────────────────────────────── */
.ded-input,
.ded-select {
    width: 100%;
    border: 1px solid #d6d0c6;
    background: white;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

    .ded-input:focus,
    .ded-select:focus {
        border-color: rgba(14,90,136,0.5);
        box-shadow: 0 0 0 4px rgba(14,90,136,0.1);
    }

    .ded-input.input-error,
    .ded-select.input-error {
        border-color: var(--error);
    }

.ded-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366635e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

textarea.ded-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ── Dedication Type Pills ──────────────────────────────────── */
.dedication-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
}

.ded-pill {
    border: 1px solid #d9d1c5;
    background: white;
    border-radius: 999px;
    padding: 13px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    color: var(--text);
}

    .ded-pill:hover {
        border-color: rgba(14,90,136,0.4);
        background: rgba(14,90,136,0.04);
    }

    .ded-pill.active {
        background: rgba(14,90,136,0.09);
        border-color: rgba(14,90,136,0.4);
        color: var(--brand-dark);
    }

/* ── Light / Donation Cards ─────────────────────────────────── */
.light-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 14px;
}

.light-card {
    border: 2px solid #ddd6cb;
    border-radius: 20px;
    background: white;
    padding: 18px 14px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

    .light-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
        border-color: rgba(14,90,136,0.35);
    }

    .light-card.selected {
        border-color: var(--brand);
        box-shadow: 0 16px 32px rgba(14,90,136,0.14);
    }

        .light-card.selected::after {
            content: "Selected";
            position: absolute;
            top: 10px;
            right: 10px;
            background: var(--brand);
            color: #fff;
            font-size: 11px;
            font-weight: 800;
            border-radius: 999px;
            padding: 5px 9px;
        }

.light-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5), 0 6px 14px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

    .light-dot.color-white {
        background: var(--light-white);
    }

    .light-dot.color-red {
        background: var(--light-red);
    }

    .light-dot.color-green {
        background: var(--light-green);
    }

    .light-dot.color-blue {
        background: var(--light-blue);
    }

    .light-dot.color-gold {
        background: var(--light-gold);
    }

.light-card h4 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: var(--text);
}

.light-price {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1;
}

.light-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    min-height: 34px;
}

/* ── Book Listing Preview ───────────────────────────────────── */
.preview-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.preview-box-label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 10px;
}

.preview-sample {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid #eee7db;
    min-height: 52px;
    word-break: break-word;
}

.preview-note {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-top: 10px;
}

/* ── Receipt Toggle (Step 2) ────────────────────────────────── */
.receipt-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.receipt-option {
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid #ddd4c9;
    background: #faf9f7;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

    .receipt-option:hover {
        border-color: rgba(14,90,136,0.3);
    }

    .receipt-option.active {
        border-color: rgba(14,90,136,0.45);
        background: rgba(14,90,136,0.06);
    }

    .receipt-option strong {
        display: block;
        font-size: 15px;
        font-weight: 800;
        margin-bottom: 6px;
        color: var(--text);
    }

    .receipt-option span {
        font-size: 13px;
        color: var(--muted);
        line-height: 1.55;
    }

/* ── Checkbox Row ───────────────────────────────────────────── */
.ded-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #faf9f7;
}

    .ded-checkbox-row input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 3px;
        flex-shrink: 0;
        accent-color: var(--brand);
        cursor: pointer;
    }

    .ded-checkbox-row label {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.6;
        color: var(--text);
        cursor: pointer;
    }

/* ── Review Grid (Step 3) ───────────────────────────────────── */
.review-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    align-items: start;
}

.review-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    background: #fcfbfa;
}

.review-group {
    padding: 18px 0;
    border-bottom: 1px solid #ece5da;
}

    .review-group:first-child {
        padding-top: 0;
    }

    .review-group:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .review-group h3 {
        font-family: 'Playfair Display', Georgia, serif;
        font-size: 20px;
        letter-spacing: -0.02em;
        margin-bottom: 14px;
        color: var(--text);
    }

.review-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 0;
    font-size: 14px;
}

    .review-row .review-label {
        color: var(--muted);
    }

    .review-row .review-value {
        font-weight: 700;
        text-align: right;
        word-break: break-word;
    }

/* ── Total Card (Step 3) ────────────────────────────────────── */
.total-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 26px;
    background: #fcfbfa;
    position: sticky;
    top: 20px;
}

    .total-card h3 {
        font-family: 'Playfair Display', Georgia, serif;
        font-size: 22px;
        margin-bottom: 6px;
        color: var(--text);
    }

.total-amount {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--text);
    margin: 4px 0 20px;
    line-height: 1;
}

.payment-note {
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef5f8;
    color: var(--brand-dark);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ── Action Rows ────────────────────────────────────────────── */
.ded-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.ded-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: var(--brand);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(14,90,136,0.22);
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
}

    .btn-primary:hover {
        background: var(--brand-dark);
        transform: translateY(-1px);
        color: white;
        text-decoration: none;
    }

.btn-secondary {
    background: #eef4f8;
    color: var(--brand-dark);
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
}

    .btn-secondary:hover {
        background: #ddeaf2;
        color: var(--brand-dark);
        text-decoration: none;
    }

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid rgba(14,90,136,0.25);
    border-radius: var(--radius-md);
    padding: 13px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
}

    .btn-ghost:hover {
        background: rgba(14,90,136,0.05);
        border-color: rgba(14,90,136,0.45);
        color: var(--brand-dark);
        text-decoration: none;
    }

.btn-danger {
    background: #fff2f2;
    color: #9a2b2b;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-danger:hover {
        background: #ffe0e0;
    }

.btn-add {
    background: white;
    color: var(--brand-dark);
    border: 1.5px dashed rgba(14,90,136,0.35);
    border-radius: var(--radius-md);
    padding: 13px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

    .btn-add:hover {
        background: rgba(14,90,136,0.04);
        border-color: rgba(14,90,136,0.55);
    }

    .btn-add:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* ── Divider between tribute cards ─────────────────────────── */
.tribute-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Validation summary box ─────────────────────────────────── */
.validation-summary-errors {
    background: #fff5f5;
    border: 1px solid #f5c2c2;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 22px;
    color: var(--error);
    font-size: 14px;
    font-weight: 600;
}

    .validation-summary-errors ul {
        margin: 6px 0 0 18px;
        padding: 0;
    }

.validation-summary-valid {
    display: none;
}

/* ── Inline error text ──────────────────────────────────────── */
span.field-validation-error {
    font-size: 13px;
    font-weight: 700;
    color: var(--error);
}

span.field-validation-valid {
    display: none;
}

/* ── Hidden utility ─────────────────────────────────────────── */
.d-none {
    display: none !important;
}

/* ── Save banner ────────────────────────────────────────────── */
.save-banner {
    background: #eef8f2;
    border: 1px solid #b4dcc6;
    border-radius: 12px;
    padding: 12px 18px;
    color: #1e6040;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ── Step indicator (breadcrumb) ────────────────────────────── */
.step-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 20px;
    padding: 0 4px;
}

    .step-breadcrumb .step-item {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--muted);
    }

        .step-breadcrumb .step-item.active {
            color: var(--brand-dark);
        }

        .step-breadcrumb .step-item.done {
            color: var(--brand);
        }

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e8e2d9;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-item.active .step-num {
    background: var(--brand);
    color: white;
}

.step-item.done .step-num {
    background: #d0ead8;
    color: #1e6040;
}

.step-sep {
    color: #c8c0b4;
    font-size: 16px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
    .review-grid {
        grid-template-columns: 1fr;
    }

    .light-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .total-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .dedication-page {
        padding-inline: 14px;
    }

    .ded-header {
        padding: 20px 20px 18px;
    }

    .ded-section {
        padding: 20px;
    }

    .ded-header h1 {
        font-size: 38px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

        .form-grid .field-full {
            grid-column: 1;
        }

    .dedication-toggle {
        grid-template-columns: 1fr;
    }

    .receipt-toggle {
        grid-template-columns: 1fr;
    }

    .light-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .ded-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ded-actions-right {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .btn-add {
        width: 100%;
        text-align: center;
    }

    .tribute-card-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-row {
        flex-direction: column;
        gap: 2px;
    }

        .review-row .review-value {
            text-align: left;
        }
}

@media (max-width: 420px) {
    .light-grid {
        grid-template-columns: 1fr;
    }
}
