* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(90, 80, 255, 0.22), transparent 32rem),
        #0b0d12;
    color: #f4f4f5;
}

.page {
    width: min(100%, 1050px);
    margin: 0 auto;
    padding: 24px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 28px 0 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 28px;
}

.eyebrow {
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0 8px;
}

h1 {
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 1;
    margin: 0;
}

.subtitle,
.form-header p,
.empty-state p {
    color: #a1a1aa;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #8b5cf6;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover {
    background: #7c3aed;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.memory-card {
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.memory-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.relationship {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
    border: 1px solid rgba(196, 181, 253, 0.18);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.date {
    color: #71717a;
    font-size: 0.75rem;
}

.memory-message {
    line-height: 1.6;
    white-space: pre-wrap;
}

.memory-name {
    color: #c4b5fd;
    font-weight: 700;
    margin-bottom: 0;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 24px;
}

.form-header {
    margin-bottom: 26px;
}

.back-link {
    color: #c4b5fd;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 22px;
}

.memory-form {
    display: grid;
    gap: 12px;
    max-width: 680px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 22px;
}

label {
    font-weight: 700;
    color: #e4e4e7;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.28);
    color: #f4f4f5;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    margin-bottom: 8px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    border-color: transparent;
}

.full-button {
    width: 100%;
    margin-top: 6px;
    font-size: 1rem;
}

.error-box {
    max-width: 680px;
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
}

@media (max-width: 650px) {
    .page {
        padding: 18px;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero .button {
        width: 100%;
    }

    .memory-grid {
        grid-template-columns: 1fr;
    }
}
