/* SecNote V1. Gestaltungsgrundlage: die bereitgestellte Medienverwaltungs-CSS.
 * Ruhiger Verlauf, Glass-Panels, Akzentblau, mobile Bedienung und System-Dark-Mode.
 */
:root {
    color-scheme: light;
    --bg: #eef3f8;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --panel-soft: rgba(246, 250, 255, 0.75);
    --text: #172033;
    --muted: #667085;
    --border: rgba(31, 41, 55, 0.13);
    --border-strong: rgba(31, 41, 55, 0.24);
    --shadow: 0 22px 55px rgba(15, 23, 42, 0.11);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.065);
    --accent: #265dff;
    --accent-hover: #1549e9;
    --accent-soft: rgba(38, 93, 255, 0.09);
    --success: #137a46;
    --success-soft: rgba(19, 122, 70, 0.1);
    --error: #b42318;
    --error-soft: rgba(180, 35, 24, 0.09);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 13px;
}
::selection { background: #ffd500; color: #121212; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
    min-height: 100%;
    background:
        radial-gradient(circle at 2% 0%, rgba(38, 93, 255, 0.15), transparent 34rem),
        linear-gradient(135deg, #f7faff 0%, var(--bg) 50%, #e8eff8 100%);
}
body {
    margin: 0;
    min-height: 100vh;
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; transition: filter .16s ease; }
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(940px, calc(100% - 40px));
    margin: 0 auto;
    padding: 31px 0 15px;
    gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-icon {
    display: inline-grid; place-items: center;
    width: 43px; height: 43px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #1746cc, #487dff);
    box-shadow: 0 8px 22px rgba(38,93,255,.22);
    font-size: 24px; font-weight: 950;
}
.brand-name { font-size: 23px; font-weight: 880; letter-spacing: -.045em; }
.header-subtitle { color: var(--muted); font-weight: 650; font-size: .85rem; }
.main-container { width: min(760px, calc(100% - 40px)); margin: auto; padding: 32px 0 45px; }
.view-card {
    padding: clamp(25px, 5vw, 47px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.12; letter-spacing: -.045em; margin: 0 0 15px; }
h2 { margin: 0 0 14px; font-size: 1.2rem; letter-spacing: -.02em; }
h3 { margin: 18px 0 8px; font-size: .98rem; }
p { margin: 0; }
.eyebrow { color: var(--accent); font-weight: 850; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.lead { max-width: 580px; font-size: 1.12rem; color: var(--muted); }
.feature-list { display: grid; gap: 19px; margin: 33px 0; }
.feature { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.feature-symbol {
    display: inline-grid; place-items: center; width: 37px; height: 37px;
    border-radius: 11px; color: var(--accent); background: var(--accent-soft);
    font-weight: 900; font-size: 1.12rem;
}
.feature strong { display: block; font-weight: 790; margin: -2px 0 2px; }
.feature p { font-size: .9rem; color: var(--muted); }
.footnote { font-size: .8rem; color: var(--muted); margin-top: 19px; }
.section-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 25px; }
.step { color: var(--muted); font-size: .82rem; font-weight: 760; }
.text-button { border: 0; padding: 0; background: none; text-decoration: none; font-size: .87rem; font-weight: 750; color: var(--accent); }
.text-button:hover { text-decoration: underline; }
.section-description { color: var(--muted); margin-bottom: 27px; }
.field-label { display: block; margin-bottom: 8px; font-size: .88rem; font-weight: 800; color: var(--muted); }
.field-label-spaced { margin-top: 15px; }
textarea, input:not([type="checkbox"]), select {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    outline: none;
    background: var(--panel-strong);
    color: var(--text);
    padding: 12px 14px;
    min-height: 48px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; min-height: 210px; line-height: 1.56; overflow-wrap: anywhere; }
textarea:focus, input:not([type="checkbox"]):focus, select:focus {
    border-color: rgba(38, 93, 255, .7);
    box-shadow: 0 0 0 4px rgba(38, 93, 255, .14);
}
input[readonly] { color: var(--text); background: var(--panel-soft); }
input::placeholder, textarea::placeholder { color: #8993a4; }
.field-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .78rem; margin-top: 8px; }
.over-limit { color: var(--error); font-weight: 850; }
.option-card { margin-top: 17px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-soft); overflow: hidden; }
.switch-line { display: flex; gap: 14px; align-items: center; padding: 16px 18px; cursor: pointer; }
.switch-line input[type="checkbox"] { appearance: auto; accent-color: var(--accent); width: 20px; height: 20px; flex: 0 0 auto; }
.switch-line strong { display: block; font-weight: 810; }
.switch-line small { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.option-details { padding: 17px 18px 19px; border-top: 1px solid var(--border); }
.inline-fields { margin-top: 14px; display: grid; grid-template-columns: minmax(90px, 1fr) minmax(130px, 1fr); gap: 14px; }
#calendar-fields { margin-top: 14px; }
.help-text { margin-top: 11px; font-size: .79rem; color: var(--muted); }
.button {
    display: inline-flex; justify-content: center; align-items: center;
    min-height: 47px; border-radius: var(--radius-md);
    padding: 11px 18px; border: 1px solid transparent;
    font-weight: 820; line-height: 1.28;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 26px rgba(38, 93, 255, .2); }
.button-primary:not(:disabled):hover { background: var(--accent-hover); box-shadow: 0 14px 31px rgba(38, 93, 255, .26); }
.button-secondary { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.62); }
.button-secondary:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.button-wide { width: 100%; }
#create-form > .button-wide { margin-top: 27px; }
.copy-row { display: flex; align-items: stretch; gap: 10px; }
.copy-row input { min-width: 0; flex: 1 1 auto; font-size: .85rem; }
.copy-row .button { flex: 0 0 auto; }
.success-symbol {
    width: 50px; height: 50px; display: grid; place-items: center;
    margin-bottom: 19px; border-radius: 17px; font-size: 27px; font-weight: 850;
    background: var(--success-soft); color: var(--success);
}
.qr-panel { display: flex; flex-direction: column; align-items: center; margin: 25px 0; padding: 26px 14px; background: var(--panel-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); }
#qr-canvas { display: block; width: min(100%, 310px); height: auto; aspect-ratio: 1; border: 1px solid #e4e8ed; background: #fff; }
.qr-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.summary { margin: 20px 0 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.summary dl, .note-meta { margin: 0; display: grid; gap: 9px; }
.summary dl div, .note-meta div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; align-items: start; }
dt { font-size: .85rem; color: var(--muted); } dd { margin: 0; font-size: .88rem; font-weight: 750; overflow-wrap: anywhere; }
#created-message, .read-note pre {
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
    margin: 0; padding: 18px; min-height: 60px; max-height: 360px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--panel-soft); color: var(--text);
    font: .94rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.note-meta { margin: 19px 0; }
#copy-message { margin-top: 10px; }
.toast { margin-bottom: 17px; padding: 12px 16px; border-radius: var(--radius-md); font-size: .9rem; font-weight: 680; background: var(--success-soft); color: var(--success); border: 1px solid rgba(19,122,70,.19); }
.toast.is-error { color: var(--error); background: var(--error-soft); border-color: rgba(180,35,24,.22); }
.error-panel { padding: 16px; margin-top: 18px; border-radius: var(--radius-md); color: var(--error); background: var(--error-soft); border: 1px solid rgba(180,35,24,.22); }
.footer { width: 100%; text-align: center; padding: 19px 18px 24px; color: var(--muted); font-size: .75rem; }
.modal-backdrop {
    position: fixed; inset: 0; z-index: 999;
    display: grid; place-items: center; overflow-y: auto;
    padding: 20px; background: rgba(15, 23, 42, .40);
    backdrop-filter: blur(8px);
}
body.has-modal { overflow: hidden; }
body.has-modal .app-shell { filter: blur(5px); pointer-events: none; }
.modal-panel {
    width: min(440px, 100%); padding: 34px;
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    background: var(--panel-strong); box-shadow: 0 25px 80px rgba(15,23,42,.26);
}
.modal-panel h2 { margin-bottom: 7px; font-size: 1.55rem; }
.modal-panel p { color: var(--muted); font-size: .9rem; }
.modal-panel .field-label { margin-top: 24px; }
.modal-lock { display: inline-grid; place-items: center; width: 41px; height: 41px; margin-bottom: 15px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.modal-panel .button { margin-top: 19px; }
.error-text { color: var(--error) !important; margin-top: 10px; }
.modal-cancel { display: block; width: max-content; margin: 17px auto 0; font-size: .88rem; color: var(--muted); text-decoration: none; }
.modal-cancel:hover { text-decoration: underline; }
@media (max-width: 620px) {
    .site-header { width: calc(100% - 28px); padding: 17px 0; }
    .brand-icon { height: 37px; width: 37px; border-radius: 11px; font-size: 21px; }
    .brand-name { font-size: 21px; }
    .header-subtitle { display: none; }
    .main-container { width: calc(100% - 18px); margin: 10px auto auto; padding: 0 0 25px; }
    .view-card { padding: 21px 17px 25px; border-radius: 19px; }
    h1 { font-size: 1.88rem; }
    .lead { font-size: 1rem; }
    .feature-list { gap: 21px; margin: 28px 0; }
    .switch-line { padding: 15px 13px; }
    .option-details { padding: 14px 13px 16px; }
    .inline-fields { gap: 9px; }
    .copy-row { flex-direction: column; }
    .copy-row .button { width: 100%; }
    .qr-actions { width: 100%; }
    .qr-actions .button { flex: 1 1 140px; }
    .modal-backdrop { padding: 12px; }
    .modal-panel { padding: 24px 20px; border-radius: 19px; }
    .summary dl div, .note-meta div { grid-template-columns: 85px 1fr; }
    .footer { font-size: .7rem; }
}
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0f172a;
        --panel: rgba(22, 28, 39, .88);
        --panel-strong: #1c2331;
        --panel-soft: rgba(255, 255, 255, .035);
        --text: #eef4ff;
        --muted: #a4b0c4;
        --border: rgba(255,255,255,.09);
        --border-strong: rgba(255,255,255,.2);
        --shadow: 0 22px 55px rgba(0,0,0,.45);
        --shadow-soft: 0 12px 32px rgba(0,0,0,.35);
        --accent: #7c9eff;
        --accent-hover: #567df8;
        --accent-soft: rgba(109,150,255,.13);
        --success: #43cb84;
        --success-soft: rgba(55,200,113,.11);
        --error: #ff8585;
        --error-soft: rgba(255,111,111,.1);
    }
    html { background: radial-gradient(circle at 2% 0%, rgba(109,150,255,.13), transparent 34rem), linear-gradient(135deg,#101623 0%,#0f172a 48%,#151f2e 100%); }
    .brand-icon, .button-primary { color: #fff; }
    .button-secondary { background: rgba(255,255,255,.06); }
    textarea, input:not([type="checkbox"]), select { background: rgba(17,24,39,.85); color: var(--text); }
    input::placeholder, textarea::placeholder { color: #8390a8; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
