/* ==========================================================================
   Projexa Mail – a Projexa dizájnrendszerére (projexa.css) épülő webmail-elemek
   ========================================================================== */

/* ---------- Logo ---------- */
.logo__sub { font-family: var(--font); font-weight: 650; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-left: 7px; padding: 2px 7px; border-radius: 6px; background: linear-gradient(135deg, rgba(23, 184, 196, .22), rgba(239, 125, 43, .22)); color: var(--orange-ink); vertical-align: 3px; }
.side .logo__sub, .logo--light .logo__sub { color: #ffd2ad; background: rgba(255, 255, 255, .09); }
.logo--light .logo__word { color: #fff; }

/* ---------- Sidebar ---------- */
.side__compose { padding: 6px 14px 6px; position: relative; z-index: 1; }
.side__compose .btn { width: 100%; }
.side__link { padding-left: calc(10px + var(--depth, 0) * 14px); }
.side__link .truncate { flex: 1; min-width: 0; }
.side__link .side__count { background: rgba(255, 255, 255, .12); color: #fff; }
.side__link.is-active .side__count, .side__link[data-folder="INBOX"] .side__count { background: var(--orange); }
.side__quota { margin: 0 14px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: #9cc3d3; position: relative; z-index: 1; display: grid; gap: 6px; }
.side__quota b { color: #fff; }
.side__quota .progress { height: 6px; background: rgba(255, 255, 255, .1); }
.side__quota .xs { color: #6f97a9; }

/* ---------- Top bar ---------- */
.top-search { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); box-shadow: var(--sh-xs); transition: border-color .15s, box-shadow .15s; }
.top-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.top-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); outline: none; height: 100%; }
.top-search input::-webkit-search-cancel-button { cursor: pointer; }
.top__compose { display: none; }

/* ---------- Message list ---------- */
.mail-card { overflow: hidden; }
.mail-tools { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); min-height: 52px; flex-wrap: wrap; }
.mail-tools__all { padding: 0 4px; }
.mail-tools__bulk { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; opacity: .45; pointer-events: none; transition: opacity .15s; }
.mail-card.has-selection .mail-tools__bulk { opacity: 1; pointer-events: auto; }
.mail-tools__move { display: inline-flex; gap: 4px; margin-left: 4px; }
.mail-tools__move .select { width: 170px; }
.mail-tools__info { margin-left: auto; font-variant-numeric: tabular-nums; }

.mlist { display: grid; }
.mrow { display: grid; grid-template-columns: 34px 30px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--border); position: relative; transition: background .1s; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--hover); }
.mrow.is-selected { background: var(--primary-50); }
.mrow.is-unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(#17b8c4, #0a85c2); }
.mrow__check { display: grid; place-items: center; height: 100%; cursor: pointer; padding-left: 6px; }
.mrow__check input, .mail-tools__all input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.mrow__star { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--muted-2); display: grid; place-items: center; border-radius: 8px; }
.mrow__star:hover { color: var(--amber); background: var(--surface-3); }
.mrow.is-flagged .mrow__star { color: var(--amber); }
.mrow.is-flagged .mrow__star svg { fill: currentColor; }
.mrow__link { display: grid; grid-template-columns: 24px minmax(120px, 220px) minmax(0, 1fr) auto 76px; gap: 12px; align-items: center; padding: 11px 16px 11px 4px; color: var(--ink-2); text-decoration: none !important; min-width: 0; }
.mrow__from { font-size: 13.5px; }
.mrow__subject { font-size: 13.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.mrow__icons { display: inline-flex; gap: 6px; color: var(--muted); }
.mrow__date { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow.is-unread .mrow__from, .mrow.is-unread .mrow__subject { color: var(--ink); font-weight: 700; }
.mrow.is-unread .mrow__date { color: var(--primary); font-weight: 700; }
.mrow__avatar { font-size: 9.5px; }

/* ---------- Reading view ---------- */
.read-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.read-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1; }
.read-actions__group { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.read-actions .dd__menu { max-height: 70vh; overflow-y: auto; }
.read { overflow: hidden; }
.read__header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.read__subject { font-family: var(--font-display); font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; overflow-wrap: anywhere; }
.read__meta { display: flex; gap: 12px; align-items: flex-start; }
.read__from { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 14.5px; }
.read__rcpt { margin-top: 3px; overflow-wrap: anywhere; }
.read__notice { display: flex; align-items: center; gap: 10px; padding: 9px 22px; background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-bd); font-size: 13px; flex-wrap: wrap; }
.read__notice .btn { margin-left: auto; }
.read__body { padding: 18px 22px 24px; }
.mail-frame { display: block; width: 100%; min-height: 160px; border: 0; background: #fff; border-radius: 10px; color-scheme: light; }
:root[data-theme="dark"] .mail-frame { box-shadow: 0 0 0 8px #fff; margin: 8px 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mail-frame { box-shadow: 0 0 0 8px #fff; margin: 8px 0; } }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.mail-text .quote-line { color: var(--muted); }
.read__attachments { padding: 14px 22px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Attachments ---------- */
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); max-width: 320px; min-width: 200px; }
.att__icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.att__main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.att__name { font-weight: 600; font-size: 13px; }
.att .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.att--check { cursor: pointer; }
.att--check input { accent-color: var(--primary); }
.att--new .att__icon { background: var(--teal-bg); color: var(--teal-ink); }

/* ---------- Composer ---------- */
.composer { overflow: visible; }
.composer__fields { border-bottom: 1px solid var(--border); }
.cfield { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); position: relative; }
.cfield:last-child { border-bottom: 0; }
.cfield[hidden] { display: none; }
.cfield > label { width: 92px; flex-shrink: 0; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.cfield__input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.cfield:focus-within > label { color: var(--primary); }
.suggest { position: absolute; left: 110px; right: 18px; top: 100%; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-l); padding: 5px; display: none; }
.suggest.is-open { display: block; animation: pop .12s ease; }
.suggest button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 7px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.suggest button.is-active, .suggest button:hover { background: var(--primary-50); }
.suggest small { color: var(--muted); }

.editor__bar { display: flex; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; position: sticky; top: 65px; z-index: 5; }
.editor__bar button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.editor__bar button:hover { background: var(--surface); box-shadow: var(--sh-xs); }
.editor__bar button.is-on { background: var(--primary-50); color: var(--primary); }
.editor__sep { width: 1px; background: var(--border-2); margin: 6px 6px; }
.editor__area { min-height: 320px; padding: 18px 20px; outline: none; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.editor__area:focus { box-shadow: inset 0 0 0 2px var(--primary-100); }
.editor__area p { margin: 0 0 .6em; }
.editor__area blockquote { margin: 0 0 .8em .3em; padding-left: 12px; border-left: 3px solid var(--border-2); color: var(--muted); }
.editor__area .signature { color: var(--muted); }
.editor__area img { max-width: 100%; height: auto; }
.editor__area table { max-width: 100%; }

.composer__attach { padding: 14px 18px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.dropzone { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px dashed var(--border-2); border-radius: 12px; color: var(--muted); cursor: pointer; font-size: 13px; flex-wrap: wrap; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer__foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }

/* ---------- Forms ---------- */
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; height: 46px; border-radius: 12px; }
.input-group .addon-select { width: auto; max-width: 55%; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; background-color: var(--surface-2); font-weight: 600; }
.input-group .addon-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; height: 40px; }
.input-group .input:has(+ .addon-btn) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- DNS ---------- */
.dns-table td:first-child { width: 240px !important; }
.dns-val { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }
.dns-val--hint { cursor: copy; background: var(--primary-50); color: var(--info-ink); }

/* ---------- Auth ---------- */
.auth-body { background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth__brand { position: relative; overflow: hidden; background: var(--grad-deep); color: #cfe3ec; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; }
.auth__brand::before { content: ''; position: absolute; inset: auto -30% -40% -30%; height: 70%; background: radial-gradient(closest-side, rgba(23, 184, 196, .25), transparent 70%); }
.auth__brand::after { content: ''; position: absolute; top: -160px; right: -160px; width: 420px; height: 420px; background: radial-gradient(closest-side, rgba(239, 125, 43, .2), transparent 70%); }
.auth__brand-inner { position: relative; z-index: 1; max-width: 520px; margin: auto 0; }
.auth__claim { font-family: var(--font-display); font-size: 38px; line-height: 1.12; color: #fff; margin: 46px 0 26px; letter-spacing: -.03em; }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 14.5px; }
.auth__points li { display: flex; gap: 10px; align-items: center; }
.auth__points .ic { color: #6fdbe3; }
.auth__foot { position: relative; z-index: 1; font-size: 12px; color: #6f97a9; }
.auth__main { display: grid; place-items: center; padding: 40px 24px; }
.auth__box { width: 100%; max-width: 400px; }
.auth__title { font-family: var(--font-display); font-size: 30px; margin-bottom: 6px; }
.auth__form { display: grid; gap: 16px; margin-top: 26px; }
.auth__form .btn--l { width: 100%; margin-top: 6px; }
.auth__mobile-logo { display: none; margin-bottom: 26px; }

/* ---------- Errors ---------- */
.err { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, var(--primary-50), transparent 50%), var(--bg); }
.err__box { max-width: 460px; width: 100%; padding: 34px 30px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.err__code { font-family: var(--font-display); font-size: 64px; font-weight: 700; line-height: 1; background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
    .mail-tools__bulk .btn span { display: none; }
    .mail-tools__bulk .btn--s { width: 30px; padding: 0; }
    .mail-tools__move .mail-tools__go { width: auto; padding: 0 10px; }
    .mail-tools__move .select { width: 150px; }
}
@media (max-width: 1200px) {
    .mrow__link { grid-template-columns: 24px minmax(110px, 170px) minmax(0, 1fr) auto 64px; }
    .read-actions .btn span { display: none; }
}
@media (max-width: 980px) {
    .auth { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__mobile-logo { display: block; }
    .top-search kbd { display: none; }
    .top__compose { display: inline-grid; }
    .mail-tools__bulk .btn span { display: none; }
}
@media (max-width: 720px) {
    .mrow { grid-template-columns: 30px 0 minmax(0, 1fr); }
    .mrow__star { display: none; }
    .mrow__link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from date" "subject icons"; gap: 2px 10px; padding: 10px 14px 10px 2px; }
    .mrow__avatar { display: none; }
    .mrow__from { grid-area: from; } .mrow__date { grid-area: date; } .mrow__subject { grid-area: subject; } .mrow__icons { grid-area: icons; }
    .mail-tools__move .select { width: 120px; }
    .read__header, .read__body { padding-left: 14px; padding-right: 14px; }
    .read__subject { font-size: 19px; }
    .read__meta .avatar--l { display: none; }
    .read__meta { flex-wrap: wrap; }
    .cfield > label { width: 64px; }
    .suggest { left: 14px; right: 14px; }
    .editor__area { min-height: 240px; padding: 14px; }
    .composer__hint { display: none; }
    .att { min-width: 0; max-width: 100%; flex: 1 1 100%; }
}
@media print {
    .read-head, .read__notice, .read__attachments .icon-btn { display: none !important; }
    .read { border: 0; }
}
