/* DINO Mail — app styles (extends landing style.css tokens) */

.hidden { display: none !important; }
.app-body { min-height: 100vh; }
.lang-float {
  position: fixed; top: 16px; right: 18px; z-index: 60;
  background: rgba(255,255,255,.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; cursor: pointer; font: inherit; font-size: .85rem;
  transition: background .2s;
}
.lang-float:hover { background: #fff; }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: stretch;
}
.auth-visual {
  position: relative; flex: 1 1 52%; min-width: 0;
  background: url("img/dino.webp") 28% center / cover no-repeat;
}
.av-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(30,48,56,.18) 0%, rgba(30,48,56,.34) 55%, rgba(30,48,56,.62) 100%);
}
.av-copy {
  position: absolute; left: clamp(28px, 4vw, 64px); bottom: clamp(32px, 6vh, 72px);
  color: #fff; max-width: 30em; text-shadow: 0 1px 12px rgba(20,40,50,.35);
}
.av-kicker {
  font-family: "Fraunces", Georgia, serif;
  font-size: .78rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
  color: #DFF3E2; margin-bottom: 12px;
}
.av-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem); font-weight: 750; line-height: 1.12;
  margin-bottom: 14px;
}
.av-quote { font-size: 1rem; font-style: italic; opacity: .92; margin-bottom: 22px; }
.av-points { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.av-points li {
  font-size: .9rem; opacity: .9; padding-left: 22px; position: relative;
}
.av-points li::before {
  content: "✉"; position: absolute; left: 0; top: 1px;
  font-size: .8rem; color: #B8E6BF;
}
.auth-side {
  flex: 1 1 48%; display: flex; align-items: center; justify-content: center;
  padding: 40px clamp(20px, 4vw, 56px);
  background: radial-gradient(900px 560px at 80% -10%, #E4DCC9 0%, var(--bg) 60%);
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 25.5rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 36px 34px 28px;
  box-shadow: 0 24px 60px rgba(34,52,59,.12);
  text-align: center;
}
.auth-mark { width: 4.75rem; height: 4.75rem; margin: 0 auto 14px; }
.auth-title { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; font-weight: 750; }
.auth-sub { color: var(--ink-soft); font-size: .92rem; margin: 4px 0 24px; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #EFEAE0; border-radius: 999px; padding: 4px; margin-bottom: 22px;
}
.auth-tab {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 0; background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 8px 0; transition: background .15s, color .15s;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(34,52,59,.12); }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-form[hidden] { display: none !important; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--ink-soft); }
.fld em { font-style: normal; opacity: .7; }
.fld input, .fld select, .fld textarea {
  font: inherit; font-size: .95rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #FDFCF9; outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.fld input:hover:not(:focus), .fld select:hover:not(:focus), .fld textarea:hover:not(:focus) {
  border-color: rgba(78,148,85,.45);
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 4px rgba(78,148,85,.14), 0 1px 4px rgba(60,122,69,.08);
  transform: translateY(-1px);
}
.fld input, .fld textarea { transition: border-color .25s, box-shadow .25s, background .25s, transform .25s; }
.fld-grow { flex: 1; }
.fld textarea { resize: vertical; line-height: 1.55; }
.auth-err {
  font-size: .85rem; color: #B4442E; background: #FBEDE8;
  border: 1px solid rgba(180,68,46,.25); border-radius: 10px; padding: 8px 12px;
}
.auth-btn { width: 100%; margin-top: 4px; position: relative; overflow: hidden; }
.auth-btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.auth-btn:hover { box-shadow: 0 8px 22px rgba(60,122,69,.35); }
.auth-btn:hover::after { transform: translateX(120%); }
.auth-btn:active { transform: translateY(1px) scale(.99); }
.auth-back { display: inline-block; margin-top: 20px; font-size: .84rem; color: var(--ink-soft); }
.auth-back:hover { color: var(--ink); }

/* address picker + live hint */
.addr-hint {
  font-size: .8rem; margin-top: 7px; padding-left: 2px;
  display: flex; align-items: center; gap: 5px;
  animation: hintIn .25s ease;
}
@keyframes hintIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.addr-hint.ok { color: var(--accent-deep); }
.addr-hint.bad { color: #B4442E; }
/* domain picker (full suffix, own row) */
.domain-pick {
  display: flex; gap: 6px; margin-top: 8px;
}
.dom-btn {
  flex: 1; font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer;
  border: 1px solid var(--line); background: #FDFCF9; color: var(--ink-soft);
  border-radius: 10px; padding: 8px 0; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s, border-color .2s, transform .15s;
}
.dom-btn:hover { color: var(--ink); border-color: rgba(78,148,85,.45); }
.dom-btn.active {
  background: var(--accent-deep); color: #fff; border-color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(60,122,69,.3);
}
.dom-btn:active { transform: scale(.97); }

/* password eye toggle (class-driven icon swap) */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; border-radius: 8px;
  color: var(--ink-soft); transition: color .2s, background .2s;
}
.pw-eye:hover { color: var(--ink); background: #F2EEE4; }
.pw-eye svg { width: 19px; height: 19px; grid-area: 1 / 1; }
.pw-eye .ic-eye-off { display: none; }
.pw-eye.showing .ic-eye { display: none; }
.pw-eye.showing .ic-eye-off { display: block; }

/* strength meter */
.strength { margin-top: 8px; }
.st-bars {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; height: 4px;
}
.st-bars i {
  border-radius: 99px; background: #E4DECF;
  transition: background .3s;
}
.strength.s1 .st-bars i:nth-child(-n+1) { background: #D9634A; }
.strength.s2 .st-bars i:nth-child(-n+2) { background: #E0A23F; }
.strength.s3 .st-bars i:nth-child(-n+3) { background: #8BB657; }
.strength.s4 .st-bars i { background: var(--accent); }
.st-label {
  display: block; font-size: .74rem; color: var(--ink-soft); margin-top: 5px;
  min-height: 1em;
}

/* ---------- mail layout ---------- */
.mail {
  display: grid; grid-template-columns: 14rem 23rem 1fr;
  height: 100vh;
}
.side {
  display: flex; flex-direction: column;
  background: #22343B; color: #E8EDEA; padding: 20px 14px 16px;
}
.side-brand { color: #fff; padding: 0 8px; }
.side .brand-mark { box-shadow: none; }
.compose-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; color: #fff; cursor: pointer;
  background: var(--accent); border: 0; border-radius: 12px;
  padding: 11px 0; margin: 22px 4px 18px;
  transition: background .15s;
}
.compose-btn:hover { background: var(--accent-deep); }
.compose-btn svg { width: 17px; height: 17px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  font: inherit; font-size: .92rem; color: rgba(232,237,234,.8);
  background: transparent; border: 0; cursor: pointer;
  border-radius: 10px; padding: 9px 12px; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.count {
  margin-left: auto; font-size: .72rem; font-weight: 700;
  background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px;
}
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.me-addr { font-size: .8rem; color: rgba(232,237,234,.75); word-break: break-all; margin-bottom: 6px; }
.signout {
  font: inherit; font-size: .8rem; color: rgba(232,237,234,.6);
  background: none; border: 0; cursor: pointer; padding: 0;
}
.signout:hover { color: #fff; }

/* list column */
.list-col { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: #FBF9F3; }
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.list-head h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; font-weight: 720; }
.refresh {
  font: inherit; background: none; border: 0; cursor: pointer; color: var(--ink-soft);
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
}
.refresh:hover { background: #EFEAE0; color: var(--ink); }
.refresh svg { width: 17px; height: 17px; }
.list { overflow-y: auto; flex: 1; }
.mail-item {
  width: 100%; text-align: left; font: inherit; background: none; border: 0;
  border-bottom: 1px solid rgba(34,52,59,.07); cursor: pointer;
  padding: 13px 20px; display: block; transition: background .12s;
}
.mail-item:hover { background: #F2EEE4; }
.mail-item.active { background: #EDE7DA; }
.mi-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.mi-from { font-weight: 650; font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-date { font-size: .76rem; color: var(--ink-soft); flex: none; }
.mi-sub { font-size: .88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-sub.empty { color: var(--ink-soft); font-style: italic; }
.mi-prev { font-size: .8rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.list-empty { padding: 46px 20px; text-align: center; color: var(--ink-soft); font-size: .9rem; }

/* read column */
.read-col { min-width: 0; display: flex; flex-direction: column; }
.read-pane { flex: 1; overflow-y: auto; }
.read-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--ink-soft);
}
.read-empty-mark { width: 64px; height: 64px; opacity: .8; }
.read-msg { padding: 30px clamp(20px, 4vw, 44px); max-width: 820px; }
.rm-sub { font-family: "Fraunces", Georgia, serif; font-size: 1.45rem; font-weight: 720; margin-bottom: 14px; }
.rm-meta {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
  font-size: .88rem;
}
.rm-from { font-weight: 700; color: var(--accent-deep); }
.rm-to { color: var(--ink-soft); }
.rm-date { color: var(--ink-soft); margin-left: auto; font-size: .8rem; }
.rm-del {
  font: inherit; font-size: .78rem; color: var(--ink-soft); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer;
}
.rm-del:hover { color: #B4442E; border-color: rgba(180,68,46,.4); }
.rm-body { font-size: .95rem; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.rm-body.html { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.rm-body pre, .rm-body.text { white-space: pre-wrap; font-family: inherit; }

/* contacts */
.pane-head { padding: 26px clamp(20px, 4vw, 44px) 6px; }
.pane-head h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; font-weight: 720; }
.pane-note { color: var(--ink-soft); font-size: .85rem; margin-top: 4px; }
.contact-list { padding: 10px clamp(20px, 4vw, 44px) 30px; display: flex; flex-direction: column; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-bottom: 1px solid rgba(34,52,59,.07);
}
.ct-ava {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  background: #DFF3E2; color: var(--accent-deep); font-weight: 700; font-size: .85rem;
  display: grid; place-items: center; text-transform: uppercase;
}
.ct-addr { font-size: .92rem; font-weight: 600; }
.ct-name { font-size: .8rem; color: var(--ink-soft); }
.ct-write {
  margin-left: auto; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  color: var(--accent-deep); background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 14px;
}
.ct-write:hover { background: #EAF4EC; }

/* admin: invite codes */
.invite-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gen-btn { padding: 9px 20px; font-size: .88rem; flex: none; }
.invite-row { font-family: ui-monospace, Consolas, monospace; }
.iv-code { font-size: .92rem; font-weight: 650; letter-spacing: .04em; }
.iv-badge {
  font-family: inherit; font-size: .74rem; font-weight: 600;
  border-radius: 999px; padding: 2px 10px;
}
.iv-badge.free { background: #DFF3E2; color: var(--accent-deep); }
.iv-badge.used { background: #EFEAE0; color: var(--ink-soft); }
.iv-del { border-color: rgba(180,68,46,.35); color: #B4442E; }
.iv-del:hover { background: #FBEDE8; }

/* ---------- compose dialog ---------- */
.compose-dlg {
  border: 0; border-radius: 18px; padding: 0;
  width: min(620px, calc(100vw - 32px));
  box-shadow: 0 30px 80px rgba(20,40,50,.3);
}
.compose-dlg::backdrop { background: rgba(20,40,50,.45); }
.compose-dlg form { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; }
.compose-head { display: flex; align-items: center; justify-content: space-between; }
.compose-head h3 { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; }
.compose-close {
  font: inherit; font-size: 1.4rem; line-height: 1; background: none; border: 0;
  cursor: pointer; color: var(--ink-soft); padding: 2px 8px; border-radius: 8px;
}
.compose-close:hover { background: #EFEAE0; color: var(--ink); }
.compose-foot { display: flex; justify-content: flex-end; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #22343B; color: #fff; font-size: .88rem;
  border-radius: 999px; padding: 10px 22px; z-index: 90;
  box-shadow: 0 10px 30px rgba(20,40,50,.3);
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .auth-visual { display: none; }
  .auth-side { min-height: 100vh; }
}
@media (max-width: 980px) {
  .mail { grid-template-columns: 13rem 1fr; }
  .read-col { display: none; }
  .read-col.open { display: flex; position: fixed; inset: 0; z-index: 40; background: var(--bg); }
  .list-col.hide-on-open { display: none; }
}
@media (max-width: 640px) {
  .mail { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; padding: 10px 14px; gap: 10px; }
  .side-brand { padding: 0; }
  .brand-name { display: none; }
  .compose-btn { margin: 0; padding: 9px 16px; }
  .side-nav { flex-direction: row; margin-left: auto; }
  .nav-item span, .nav-item:not(:has(.count)) svg + * { }
  .nav-item { padding: 8px 10px; }
  .nav-item svg + * { display: none; }
  .count { position: absolute; transform: translate(14px, -8px); }
  .side-foot { margin: 0; border: 0; padding: 0; }
  .me-addr { display: none; }
}
