/* ============================================================
   Müllfach.de – Haupt-Stylesheet
   Design: Clean Light / Professional White
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #f8f9fc;
    --bg-2:         #f0f2f7;
    --bg-3:         #e8ebf2;
    --bg-4:         #dde1ec;
    --surface:      #ffffff;
    --border:       #e2e6ef;
    --border-dark:  #c8cedf;

    --text:         #1a1d2e;
    --text-2:       #5a6080;
    --text-3:       #8890aa;

    --accent:       #2563eb;
    --accent-light: #eff4ff;
    --accent-mid:   #93b4fd;
    --accent-dark:  #1d4ed8;
    --accent-glow:  rgba(37,99,235,.12);

    --green:        #16a34a;
    --danger:       #dc2626;

    --font-sans:  'Space Grotesk', system-ui, sans-serif;
    --font-mono:  'JetBrains Mono', 'Courier New', monospace;

    --radius-sm:  8px;
    --radius:     14px;
    --radius-lg:  22px;

    --shadow-xs:  0 1px 3px rgba(30,40,80,.07);
    --shadow-sm:  0 2px 8px rgba(30,40,80,.09);
    --shadow:     0 4px 20px rgba(30,40,80,.10);
    --shadow-lg:  0 8px 30px rgba(30,40,80,.12);
    --shadow-xl:  0 20px 50px rgba(30,40,80,.14);

    --t: 200ms ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-dark); }
ul, ol { list-style: none; }
#main-content { flex: 1; }

h1,h2,h3,h4 { line-height: 1.2; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }
.mono { font-family: var(--font-mono); }
.small { font-size: .85rem; color: var(--text-2); }

/* ── Cookie Banner ── */
.cookie-banner {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    width: min(620px, calc(100vw - 2rem));
    background: var(--surface);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    animation: slideUp .3s ease;
}
.cookie-inner {
    display: flex; flex-direction: column; gap: .85rem;
    padding: 1.4rem 1.75rem;
}
.cookie-inner strong { font-size: .95rem; }
.cookie-inner p { font-size: .86rem; color: var(--text-2); line-height: 1.6; }
.cookie-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
@keyframes slideUp {
    from { opacity:0; transform:translateX(-50%) translateY(14px); }
    to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ── Header ── */
.site-header {
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-xs);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    padding: .85rem 1.5rem;
    display: flex; align-items: center; gap: 2rem;
}
.logo { flex-shrink: 0; }
.logo img { height: 36px; width: auto; }
.nav-links { display: flex; gap: .2rem; margin-left: auto; }
.nav-links a {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--text-2); font-size: .88rem; font-weight: 500;
    transition: color var(--t), background var(--t);
}
.nav-links a:hover { color: var(--text); background: var(--bg-2); }
.nav-links a.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: .5rem; font-size: 1.5rem; margin-left: auto; }
.nav-mobile {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--border);
    padding: .75rem 1.5rem; gap: .2rem;
    background: var(--surface);
}
.nav-mobile a {
    display: flex; align-items: center; gap: .5rem;
    padding: .6rem .75rem; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: .9rem;
    transition: background var(--t), color var(--t);
}
.nav-mobile a:hover, .nav-mobile a.active { background: var(--accent-light); color: var(--accent); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans); font-size: .9rem; font-weight: 600;
    cursor: pointer; border: none;
    transition: background var(--t), transform .1s, box-shadow var(--t);
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 4px 16px rgba(37,99,235,.4); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-dark); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-sm { padding: .45rem .95rem; font-size: .84rem; }
.btn-link {
    background: none; border: none; color: var(--text-2); font-size: .85rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: .3rem;
    padding: 0; text-decoration: underline; transition: color var(--t);
}
.btn-link:hover { color: var(--text); }
.icon-btn {
    background: var(--surface); border: 1.5px solid var(--border-dark); color: var(--text-2);
    border-radius: var(--radius-sm); padding: .45rem .55rem; cursor: pointer;
    display: inline-flex; align-items: center;
    transition: background var(--t), color var(--t), border-color var(--t); font-size: 1.1rem;
}
.icon-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent-mid); }

/* ── Hero ── */
.hero {
    padding: 5rem 1.5rem 4.5rem;
    background: linear-gradient(155deg, #eef3ff 0%, #f8f9fc 55%, #f0f2f7 100%);
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.hero::before {
    content: '';
    position: absolute; top: -100px; right: -60px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    max-width: 680px; margin: 0 auto;
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 1.5rem;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--accent-light); border: 1.5px solid var(--accent-mid);
    color: var(--accent); padding: .38rem 1rem; border-radius: 100px;
    font-size: .8rem; font-weight: 600;
}
.hero h1 .highlight { color: var(--accent); }
.hero-sub { color: var(--text-2); font-size: 1.05rem; max-width: 520px; }

/* Address Card */
.address-card {
    width: 100%; max-width: 560px;
    background: var(--surface);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}
.tabs { display: flex; border-bottom: 1.5px solid var(--border); background: var(--bg-2); }
.tab {
    flex: 1; padding: .78rem;
    background: none; border: none; color: var(--text-2);
    font-family: var(--font-sans); font-size: .88rem; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem;
    transition: color var(--t), background var(--t);
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); font-weight: 600; }
.tab-panel { padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.tab-panel[hidden] { display: none; }

.address-display {
    display: flex; align-items: center;
    background: var(--bg-2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); padding: .78rem 1rem; gap: .7rem;
}
.address-display span {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .97rem; color: var(--accent); font-weight: 600;
}
.address-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.address-actions .btn { flex: 1; justify-content: center; }

.custom-input-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.custom-input-wrap {
    flex: 1; min-width: 200px;
    display: flex; align-items: center;
    background: var(--bg-2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: border-color var(--t), box-shadow var(--t);
}
.custom-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.custom-input {
    flex: 1; background: none; border: none; outline: none;
    padding: .73rem 1rem; color: var(--text); font-size: .93rem; font-family: var(--font-mono);
}
.domain-suffix {
    padding: .73rem .75rem .73rem 0;
    color: var(--text-2); font-family: var(--font-mono); font-size: .88rem; white-space: nowrap;
}
.validation-msg { font-size: .82rem; min-height: 1.2em; }
.validation-msg.ok  { color: var(--green); }
.validation-msg.err { color: var(--danger); }

.hero-visual { display: none; }
@media (min-width: 1000px) {
    .hero-visual { display: block; position: absolute; right: 5%; top: 50%; transform: translateY(-50%); pointer-events: none; }
}
.floating-mail { position: absolute; font-size: 3rem; color: var(--accent); opacity: .12; animation: float 6s ease-in-out infinite; }
.fm1 { top: -60px; right: 20px; font-size: 4rem; }
.fm2 { top: 60px; right: -30px; animation-delay: 2s; font-size: 2.5rem; opacity: .07; }
.fm3 { top: 130px; right: 60px; animation-delay: 4s; font-size: 3rem; opacity: .06; }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-14px); } }

/* ── Features ── */
.features { padding: 5rem 1.5rem; background: var(--surface); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: .75rem; }
.section-sub { text-align: center; color: var(--text-2); max-width: 520px; margin: 0 auto 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px,1fr)); gap: 1.25rem; }
.feature-card {
    background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 1.75rem; transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.feature-card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
    width: 48px; height: 48px; background: var(--accent-light);
    border: 1.5px solid var(--accent-mid); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--accent); margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: .4rem; }
.feature-card p { color: var(--text-2); font-size: .9rem; line-height: 1.65; }

/* ── FAQ ── */
.faq { padding: 4.5rem 1.5rem 5rem; }
.faq-list { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: .65rem; }
.faq-item {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color var(--t), box-shadow var(--t);
}
.faq-item[open] { border-color: var(--accent-mid); box-shadow: var(--shadow-sm); }
.faq-q {
    display: flex; align-items: center; gap: .7rem;
    padding: 1.05rem 1.2rem;
    cursor: pointer; font-weight: 600; font-size: .93rem;
    list-style: none; user-select: none; color: var(--text);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q i:first-child { color: var(--accent); flex-shrink: 0; }
.faq-caret { margin-left: auto; transition: transform var(--t); flex-shrink: 0; color: var(--text-2); }
.faq-item[open] .faq-caret { transform: rotate(180deg); }
.faq-a {
    padding: .9rem 1.2rem 1.1rem 3.1rem;
    color: var(--text-2); font-size: .9rem; line-height: 1.7;
    border-top: 1px solid var(--border);
}

/* ── Postfach ── */
.inbox-page { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
.inbox-header { display: flex; flex-direction: column; gap: .9rem; padding-bottom: 1.25rem; border-bottom: 1.5px solid var(--border); margin-bottom: 1.25rem; }
.inbox-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.inbox-title-row h1 { display: flex; align-items: center; gap: .55rem; font-size: 1.4rem; color: var(--accent); }
.inbox-address-badge {
    display: flex; align-items: center; gap: .5rem;
    background: var(--accent-light); border: 1.5px solid var(--accent-mid);
    border-radius: var(--radius-sm); padding: .38rem .9rem;
}
.inbox-address-badge span { font-size: .88rem; color: var(--accent); font-weight: 600; }
.inbox-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.auto-refresh-status { display: flex; align-items: center; gap: .4rem; color: var(--text-2); font-size: .8rem; margin-left: auto; }

.inbox-layout {
    display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem;
    height: calc(100vh - 210px); min-height: 500px;
}
.mail-list-panel {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    overflow-y: auto; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
}
.list-loading, .mail-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; gap: 1rem; padding: 2rem; text-align: center; color: var(--text-2); font-size: .9rem;
}
.mail-empty i { font-size: 3rem; opacity: .2; color: var(--accent); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mail-list { flex: 1; overflow-y: auto; }
.mail-item {
    padding: .95rem 1.1rem; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background var(--t);
    display: flex; flex-direction: column; gap: .28rem;
}
.mail-item:hover { background: var(--bg-2); }
.mail-item.active { background: var(--accent-light); border-left: 3px solid var(--accent); }
.mail-item.unread .mail-item-subject { font-weight: 600; color: var(--text); }
.mail-item-from { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item-subject { font-size: .88rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item-date { font-size: .73rem; color: var(--text-3); opacity: .7; }

.mail-viewer {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
}
.viewer-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 1rem; color: var(--text-2); text-align: center; padding: 2rem; }
.viewer-empty i { font-size: 3.5rem; opacity: .15; color: var(--accent); }
#mail-viewer-content { display: flex; flex-direction: column; height: 100%; }
.mail-meta { padding: 1.25rem 1.5rem; border-bottom: 1.5px solid var(--border); background: var(--bg-2); }
.mail-subject { font-size: 1.05rem; margin-bottom: .7rem; }
.mail-details { display: grid; grid-template-columns: auto 1fr; gap: .28rem 1rem; font-size: .84rem; }
.mail-details dt { color: var(--text-2); font-weight: 600; }
.mail-details dd { color: var(--text); }
.mail-body-container { flex: 1; overflow: hidden; }
.mail-frame { width: 100%; height: 100%; border: none; background: #fff; }
.mail-text-fallback { padding: 1.5rem; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: .84rem; color: var(--text); overflow-y: auto; height: 100%; }

/* ── Legal ── */
.legal-page { padding: 3rem 1.5rem; }
.legal-inner { max-width: 780px; margin: 0 auto; }
.legal-header { text-align: center; margin-bottom: 3rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; padding-bottom: 2.5rem; border-bottom: 1.5px solid var(--border); }
.legal-header i { font-size: 2.5rem; color: var(--accent); }
.legal-header h1 { font-size: 2rem; }
.legal-header p { color: var(--text-2); }
.legal-content h2 { font-size: 1.1rem; margin: 2.5rem 0 .7rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.legal-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.legal-content h3 { font-size: .88rem; margin: 1.25rem 0 .4rem; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.legal-content p, .legal-content address { color: var(--text-2); margin-bottom: .75rem; line-height: 1.8; font-size: .93rem; }
.legal-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content ul li { color: var(--text-2); font-size: .93rem; margin-bottom: .3rem; list-style: disc; }
.legal-content a { color: var(--accent); }
.legal-content strong { color: var(--text); }
.legal-updated { color: var(--text-3); font-size: .8rem; margin-top: 3rem; display: flex; align-items: center; gap: .4rem; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1.5px solid var(--border); margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem 2rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
.footer-brand img { margin-bottom: .75rem; }
.footer-brand p { color: var(--text-2); font-size: .87rem; line-height: 1.7; }
.footer-links ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-2); font-size: .87rem; transition: color var(--t); }
.footer-links a:hover { color: var(--accent); }
.footer-info p { display: flex; align-items: flex-start; gap: .4rem; color: var(--text-2); font-size: .84rem; margin-bottom: .6rem; line-height: 1.5; }
.footer-info i { color: var(--accent); flex-shrink: 0; margin-top: .15rem; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.2rem 1.5rem; text-align: center; font-size: .79rem; color: var(--text-2); background: var(--bg-2); }
.footer-bottom a { color: var(--text-2); }
.footer-bottom a:hover { color: var(--accent); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8bf; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .inbox-layout { grid-template-columns: 1fr; grid-template-rows: 300px 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
}
@media (max-width: 600px) {
    .address-actions { flex-direction: column; }
    .inbox-page { padding: 1rem; }
    .hero { padding: 3.5rem 1.25rem 3rem; }
}

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
