/* Norya — base stylesheet (mobile-first) */

:root {
    --bg: #faf6f2;
    --surface: #ffffff;
    --ink: #2d2327;
    --ink-soft: #6f6168;
    --line: #e9ddd4;
    --accent: #b4405f;
    --accent-dark: #8d2f4b;
    --accent-soft: #f6e3e9;
    --ok-bg: #e8f5e9;
    --ok-ink: #2e7d32;
    --err-bg: #fdecea;
    --err-ink: #b00020;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(45, 35, 39, 0.07), 0 8px 24px rgba(45, 35, 39, 0.06);
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}

h1, h2 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.25;
}

h1 { font-size: 1.6rem; margin: 1.25rem 0 0.75rem; text-align: center; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

p { margin: 0.5rem 0; }

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    font-style: italic;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.logout-form { margin: 0; }

.link-button {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.link-button:hover { color: var(--accent); }

/* Layout */
.container {
    max-width: 34rem;
    margin: 1.25rem auto 3.5rem;
    padding: 0 1.1rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.35rem;
    margin: 0.9rem 0;
    box-shadow: var(--shadow);
}

/* Forms */
form { margin: 0; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.3rem;
}

input[type=text], input[type=password], input[type=number],
input[type=date], input[type=url], input[type=email],
input[type=file], select, textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbb9ae;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

form p { margin: 0 0 0.9rem; }

textarea { resize: vertical; min-height: 8rem; }

button[type=submit], button {
    font: inherit;
    font-weight: 600;
    width: 100%;
    padding: 0.7rem 1rem;
    margin-top: 0.3rem;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

button:hover { background: var(--accent-dark); }

.link-button { width: auto; }

/* Field + form errors */
.field-error, .error, .errorlist li {
    display: block;
    color: var(--err-ink);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.errorlist { margin: 0.4rem 0; padding-left: 1.1rem; color: var(--err-ink); }

/* Flash messages */
.messages {
    list-style: none;
    margin: 0.8rem 0 0;
    padding: 0;
}
.messages li {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.messages li.success { background: var(--ok-bg); color: var(--ok-ink); }
.messages li.error { background: var(--err-bg); color: var(--err-ink); }

/* Login */
.card h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }

/* Configure wizard */
.card h2 { font-size: 1.05rem; }

/* Photos */
.photo-list { list-style: none; margin: 0.5rem 0 1rem; padding: 0; }
.photo-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
}
.photo-list li:last-child { border-bottom: none; }
.photo-list form { display: flex; align-items: center; gap: 0.6rem; width: auto; margin: 0; }
.photo-list button {
    width: auto;
    padding: 0.3rem 0.7rem;
    margin: 0;
    font-size: 0.85rem;
    background: #fff;
    color: var(--err-ink);
    border: 1px solid var(--err-ink);
}
.photo-list button:hover { background: var(--err-bg); }

/* Couple page */
.couple-title { text-align: center; margin: 1.4rem 0 1.1rem; }

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    margin: 1rem 0 1.3rem;
    padding: 0;
}

.gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
}

.gallery:has(img:nth-child(5)) { grid-template-columns: repeat(3, 1fr); }

.photo-missing { color: var(--ink-soft); font-style: italic; }

.letter p { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.7; }

.date-list { list-style: none; margin: 0.4rem 0 1rem; padding: 0; }
.date-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
}
.date-list li:last-child { border-bottom: none; }
.date-list form { display: inline; margin: 0; }
.date-list button {
    width: auto;
    margin: 0;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    background: none;
    color: var(--ink-soft);
    text-decoration: underline;
}
.date-list a { font-size: 0.85rem; }

iframe {
    border: none;
    border-radius: var(--radius);
    background: #191414;
}

.owner-tools {
    text-align: center;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-top: 1.6rem;
}

/* Login code reveal */
.code-card { text-align: center; }
.code-card .warning { color: var(--err-ink); font-size: 0.95rem; }
.login-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.6rem;
    letter-spacing: 0.18em;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-radius: 10px;
    padding: 0.85rem 0.6rem;
    margin: 1.1rem 0;
    user-select: all;
}
.code-card button { width: auto; padding: 0.6rem 1.4rem; }

/* Footer hints (activate link etc.) */
.container > p { text-align: center; color: var(--ink-soft); font-size: 0.95rem; }

@media (min-width: 720px) {
    h1 { font-size: 2rem; }
    .container { max-width: 40rem; }
    .gallery { grid-template-columns: repeat(3, 1fr); }
    .gallery:has(img:nth-child(5)) { grid-template-columns: repeat(4, 1fr); }
}
