/* ============================================================
   MyMemory — Wizard Form Styles
   ============================================================ */

.form-page {
    min-height: 100dvh;
    background: var(--bg);
}

.form-hero {
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
    padding: var(--sp-16) 0 var(--sp-8);
    text-align: center;
}

.form-hero h1 {
    margin-bottom: var(--sp-3);
}

.form-hero p {
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

/* Product badge */
.form-product-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px 20px;
    background: var(--gold-bg);
    border: 1px solid rgba(196, 162, 101, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: var(--sp-6);
}

/* Progress */
.wizard-progress {
    padding: var(--sp-6) 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
}

.wizard-progress__inner {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--sp-6);
}

.wizard-progress__step {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--border);
    position: relative;
    transition: background 0.4s var(--ease);
    cursor: pointer;
}

.wizard-progress__step.completed {
    background: var(--gold);
}

.wizard-progress__step.active {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.wizard-progress__step:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.wizard-progress__info {
    display: flex;
    justify-content: space-between;
    max-width: 800px;
    margin: var(--sp-3) auto 0;
    padding: 0 var(--sp-6);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* Form Container */
.wizard-body {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp-10) var(--sp-6) var(--sp-20);
}

/* Step Sections */
.wizard-step {
    display: none;
    animation: fadeInUp 0.4s var(--ease) both;
}

.wizard-step.active {
    display: block;
}

.wizard-step__header {
    margin-bottom: var(--sp-8);
}

.wizard-step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    font-size: var(--fs-xs);
    font-weight: 700;
    margin-bottom: var(--sp-3);
}

.wizard-step__header h2 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--sp-2);
}

.wizard-step__header p {
    color: var(--text-secondary);
    font-size: var(--fs-base);
}

.wizard-step__hint {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    background: var(--gold-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(196, 162, 101, 0.15);
    margin-bottom: var(--sp-8);
    font-size: var(--fs-sm);
    color: var(--gold-dark);
    line-height: 1.6;
}

.wizard-step__hint svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* List builder (children, siblings, etc.) */
.list-builder {
    margin-bottom: var(--sp-6);
}

.list-builder__items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.list-builder__item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 6px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
}

.list-builder__item button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 12px;
    color: var(--text-muted);
    transition: all var(--duration) var(--ease);
}

.list-builder__item button:hover {
    color: var(--error);
    background: var(--error-bg);
}

.list-builder__add {
    display: flex;
    gap: var(--sp-2);
}

.list-builder__add input {
    flex: 1;
    padding: 8px 14px;
    font-size: var(--fs-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    transition: border-color var(--duration) var(--ease);
}

.list-builder__add input:focus {
    border-color: var(--gold);
}

.list-builder__add button {
    padding: 8px 16px;
    background: var(--gold-bg);
    color: var(--gold-dark);
    border: 1px solid rgba(196, 162, 101, 0.3);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}

.list-builder__add button:hover {
    background: var(--gold);
    color: white;
}

/* Photo Upload */
.photo-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-10);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: var(--bg);
}

.photo-upload-zone:hover,
.photo-upload-zone.dragover {
    border-color: var(--gold);
    background: var(--gold-bg);
}

.photo-upload-zone__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--sp-4);
    background: var(--gold-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.photo-upload-zone__icon svg {
    width: 24px;
    height: 24px;
}

.photo-upload-zone h4 {
    font-size: var(--fs-base);
    margin-bottom: var(--sp-2);
}

.photo-upload-zone p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-4);
    margin-top: var(--sp-6);
}

.photo-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--surface);
    border: 2px solid transparent;
    transition: border-color var(--duration) var(--ease);
    cursor: pointer;
}

.photo-item:hover {
    border-color: var(--gold);
}

.photo-item.cover-photo {
    border-color: var(--gold);
}

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

.photo-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--sp-2) var(--sp-3);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.photo-item:hover .photo-item__overlay {
    opacity: 1;
}

.photo-item__tag {
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: rgba(196, 162, 101, 0.9);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.photo-item__remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.photo-item__remove:hover {
    background: var(--error);
}

.photo-item__cover-badge {
    position: absolute;
    top: var(--sp-2);
    left: var(--sp-2);
    padding: 2px 8px;
    background: var(--gold);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Photo tag selector */
.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--sp-10);
    padding-top: var(--sp-8);
    border-top: 1px solid var(--border-light);
}

.wizard-nav__skip {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--duration) var(--ease);
}

.wizard-nav__skip:hover {
    color: var(--gold);
}

.wizard-nav__buttons {
    display: flex;
    gap: var(--sp-3);
}

/* Autosave indicator */
.autosave-indicator {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: var(--sp-4);
}

.autosave-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.autosave-indicator.saving .autosave-indicator__dot {
    background: var(--warning);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Consent section */
.consent-section {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: var(--sp-8);
    margin-top: var(--sp-6);
}

.consent-section h4 {
    margin-bottom: var(--sp-6);
}

/* Checkout summary */
.checkout-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--sp-8);
    margin-top: var(--sp-8);
}

.checkout-summary h4 {
    margin-bottom: var(--sp-4);
}

.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.checkout-summary__row:last-of-type {
    border-bottom: none;
}

.checkout-summary__total {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-4) 0 0;
    border-top: 2px solid var(--border);
    margin-top: var(--sp-2);
    font-weight: 700;
    font-size: var(--fs-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-progress__inner {
        gap: 3px;
    }

    .wizard-progress__step {
        height: 4px;
    }

    .wizard-body {
        padding: var(--sp-6) var(--sp-4) var(--sp-16);
    }

    .wizard-nav {
        flex-direction: column-reverse;
        gap: var(--sp-4);
        align-items: stretch;
    }

    .wizard-nav__buttons {
        flex-direction: column-reverse;
    }

    .wizard-nav__buttons .btn {
        width: 100%;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--sp-3);
    }

    .form-hero {
        padding: var(--sp-10) 0 var(--sp-6);
    }
}
/* Photo cards with the family's own caption and date under each photo */
.photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.photo-item {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    cursor: default;
}

.photo-item img {
    aspect-ratio: 1;
    height: auto;
}

.photo-item__remove {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-2);
    width: auto;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
}

.photo-item__details {
    display: grid;
    gap: var(--sp-2);
    padding: var(--sp-2);
}

.photo-item__details .form-input {
    font-size: 14px;
    padding: var(--sp-2);
}
