/* Urlaubstagebuch – Design „Reisetagebuch“
   Warme Papiertöne, Terrakotta für die wichtigste Aktion, Salbei für Zustände.
   Typo: Fraunces für Titel, Figtree für die Bedienung. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Figtree:wght@400;500;600;700&display=swap');

:root {
    /* alte Namen bleiben bestehen, damit alle Seiten und Editoren sie weiter nutzen */
    --paper: #f6f0e4;
    --paper-line: #e2d6c2;
    --ink: #2f2a24;
    --ink-soft: #7a6f61;
    --map-blue: #b8553a;        /* Akzent (Terrakotta) */
    --map-blue-deep: #8f3f29;
    --gold: #b9852c;
    --gold-soft: #f1e2c2;
    --error: #a3392c;
    --radius: 10px;
    /* neu */
    --surface: #fbf7ef;
    --surface-2: #efe6d4;
    --sage: #5f7d5c;
    --shadow: 0 2px 10px rgba(80, 60, 30, 0.10);
    --shadow-lg: 0 10px 30px rgba(80, 60, 30, 0.18);
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-ui: "Figtree", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.4em;
    color: var(--ink);
    text-wrap: balance;
}

a { color: var(--map-blue-deep); text-underline-offset: 3px; }
a:hover { color: var(--map-blue); }
:focus-visible { outline: 3px solid rgba(184, 85, 58, 0.45); outline-offset: 2px; }

.screen { min-height: 100vh; display: flex; }

/* --- Login / Auth-Seiten --- */
.auth-layout { display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; min-height: 100vh; }

.auth-story {
    background: linear-gradient(155deg, #c0654a 0%, #8f3f29 55%, #5a2a1d 100%);
    color: #fbf1e3;
    padding: 4rem 3.5rem;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-story::after {
    content: ""; position: absolute; right: -80px; bottom: -80px; width: 300px; height: 300px;
    border: 1.5px dashed rgba(251, 241, 227, 0.3); border-radius: 50%;
}
.auth-story .stamp {
    align-self: flex-start; border: 1.5px solid rgba(251, 241, 227, 0.6); color: #fbf1e3;
    padding: 0.35em 0.9em; border-radius: 999px; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.auth-story h1 { color: #fff; font-size: 2.6rem; line-height: 1.1; max-width: 12ch; margin-top: 2rem; }
.auth-story p { color: rgba(251, 241, 227, 0.85); max-width: 34ch; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 390px; }
.auth-card .eyebrow { color: var(--map-blue-deep); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }

/* --- Formulare --- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.88rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: 0.7em 0.85em; border: 1px solid var(--paper-line); border-radius: var(--radius);
    font: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 3px solid rgba(184, 85, 58, 0.25); outline-offset: 0; border-color: var(--map-blue);
}

/* --- Knöpfe --- */
.btn {
    display: inline-block; width: 100%; padding: 0.75em 1.1em;
    background: var(--map-blue); color: #fff; border: 1px solid var(--map-blue); border-radius: var(--radius);
    font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 1px 2px rgba(80, 40, 20, 0.18);
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--map-blue-deep); border-color: var(--map-blue-deep); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--paper-line); box-shadow: none; }
.btn-secondary:hover { background: var(--surface-2); border-color: #cdbd9f; color: var(--ink); }

.link-row { margin-top: 0.9rem; font-size: 0.9rem; display: flex; justify-content: space-between; }

.message { padding: 0.75em 1em; border-radius: var(--radius); font-size: 0.92rem; margin-bottom: 1rem; }
.message.error { background: #fbe9e6; color: var(--error); border: 1px solid #f0c9c2; }
.message.success { background: #e8f0e4; color: #3c6b2e; border: 1px solid #cfe3c5; }

/* --- App-Shell (nach Login) --- */
.app-header {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem;
    padding: 0.7rem 2rem; background: rgba(251, 247, 239, 0.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--paper-line);
}
.app-header .brand { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.app-header .header-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.4rem; }
.app-header .header-links a { white-space: nowrap; text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; font-weight: 500; padding: 0 0.8em; border-radius: 999px; }
.app-header .header-links a:hover { background: var(--surface-2); color: var(--ink); }

.app-main { padding: 2rem; max-width: 1040px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem 1rem; margin-bottom: 1.2rem; }
.page-head h2 { margin: 0; font-size: 1.9rem; }
.btn-inline { width: auto; padding: 0.6em 1.2em; }

.card-form { padding: 1.3rem; background: var(--surface); border: 1px solid var(--paper-line); border-radius: 14px; box-shadow: var(--shadow); }

/* Kacheln (Übersicht) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.tile { background: var(--surface); border: 1px solid var(--paper-line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tile-cover {
    aspect-ratio: 16 / 10; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 0.9rem 1rem;
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; line-height: 1.15; color: #fff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); background-color: #8f7a5c;
}
.tile-cover.g1 { background-image: linear-gradient(160deg, #2c7da0 0%, #61a5c2 45%, #e9d8a6 100%); }
.tile-cover.g2 { background-image: linear-gradient(160deg, #355c3c 0%, #6a994e 55%, #d4c99a 100%); }
.tile-cover.g3 { background-image: linear-gradient(160deg, #c8553d 0%, #f2cc8f 55%, #81b29a 100%); }
.tile-cover.has-photo { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.tile-cover.has-photo::before { content: ""; position: absolute; }
.tile-body { padding: 0.9rem 1rem 0.4rem; color: var(--ink-soft); font-size: 0.9rem; }
.tile-body .desc { margin-top: 0.2rem; color: var(--ink); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0.9rem 1rem; }
.tile-actions .btn { width: auto; padding: 0.45em 0.9em; font-size: 0.88rem; min-height: 38px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tile-actions .btn.danger { color: var(--error); }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--ink-soft); border: 2px dashed var(--paper-line); border-radius: 16px; }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; min-width: 560px; border-collapse: collapse; margin-top: 1rem; }
table.list th, table.list td { text-align: left; padding: 0.7em 0.8em; border-bottom: 1px solid var(--paper-line); font-size: 0.92rem; }
table.list th { color: var(--ink-soft); font-weight: 600; }

.badge { display: inline-block; padding: 0.15em 0.65em; border-radius: 999px; font-size: 0.78rem; background: var(--gold-soft); color: #6b4a12; font-weight: 600; }
.badge.admin { background: var(--map-blue); color: #fff; }

.row-actions button { background: none; border: none; color: var(--map-blue-deep); cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 500; padding: 0; margin-right: 0.8rem; }
.row-actions button.danger { color: var(--error); }

/* Größere Tap-Ziele für Touch-Bedienung */
.btn, .row-actions button, .header-links a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.link-row a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 760px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { display: none; }
    body { font-size: 16.5px; }
    .app-header { padding: 0.6rem 1.1rem; }
    .app-main { padding: 1.25rem 1.1rem; }
    .auth-form-side { padding: 1.25rem; min-height: 100vh; }
    #createForm { flex-direction: column; align-items: stretch !important; gap: 0.9rem; }
    #createForm .field, #createForm select, #createForm .btn { width: 100%; }
    .row-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
    .row-actions button { margin-right: 0; }
    .page-head h2 { font-size: 1.55rem; }
    .tile-grid { grid-template-columns: 1fr; }
    #userLabel { display: none; }
}
@media (max-width: 420px) { .auth-card .eyebrow { font-size: 0.78rem; } .app-header .brand { font-size: 1.15rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.tile-cover { position: relative; }
.cover-pick { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); border: 0; border-radius: 99px; padding: 4px 11px; font: 500 .78rem var(--font-ui); color: var(--ink); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* Momente: Typ-Auswahl und Reiter */
.type-tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin: 0 0 1rem; }
.type-tab { border: 1px solid var(--paper-line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: .4em 1em; font: 500 .88rem var(--font-ui); cursor: pointer; }
.type-tab.on { background: var(--map-blue); border-color: var(--map-blue); color: #fff; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.type-card { text-align: left; border: 1px solid var(--paper-line); background: var(--surface); border-radius: 14px; padding: .8rem .9rem; cursor: pointer; font-family: var(--font-ui); color: var(--ink); display: flex; flex-direction: column; gap: .2rem; }
.type-card:hover { border-color: var(--map-blue); box-shadow: var(--shadow); }
.type-card .ti { font-size: 1.6rem; }
.type-card small { color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
.badge.type-badge { background: var(--surface-2); color: var(--ink); }
