/* =====================================================
   Temp Mail — NEO-BRUTALISM UI
   Flat colors · thick black borders · hard offset shadows
   ===================================================== */
:root {
  --bg: #f3e9d2;
  --bg-soft: #fffdf5;
  --panel: #fffdf5;
  --panel-2: #ffe600;
  --panel-border: #111111;
  --ink: #111111;
  --text: #111111;
  --text-dim: #4a4a4a;
  --primary: #2b50ff;
  --primary-2: #2b50ff;
  --accent: #00c46a;
  --danger: #ff3b30;
  --warning: #ff9500;
  --radius: 0px;
  --border-w: 3px;
  --shadow: 6px 6px 0 0 var(--ink);
  --shadow-sm: 4px 4px 0 0 var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- background orbs: removed for flat brutalism ---- */
.bg-orbs {
  display: none;
}

/* ---- header ---- */
.site-header {
  position: relative;
  z-index: 2;
  padding: 16px 0;
  border-bottom: var(--border-w) solid var(--ink);
  background: var(--panel-2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  font-size: 28px;
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 4px 8px;
  line-height: 1;
}
.brand-text strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 800;
}
.brand-text small {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

/* ---- domain badges ---- */
.domain-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: var(--border-w) solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: currentColor;
  border: 2px solid var(--ink);
}
.badge-approved {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--accent);
}
.badge-checking {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--warning);
}
.badge-disconnected {
  color: #fff;
  border-color: var(--ink);
  background: var(--danger);
}
.badge-checking .dot {
  animation: pulse 1.2s steps(2, end) infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

/* ---- layout ---- */
.main-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 48px;
}
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---- hero / address ---- */
.hero-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.hero-sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.email-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 6px 6px 6px 14px;
  box-shadow: var(--shadow-sm);
}
.email-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: "Cascadia Code", "Consolas", monospace;
  min-width: 0;
}
.email-local {
  flex: 1 1 auto;
  text-align: right;
}
.email-at {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  font-family: "Cascadia Code", "Consolas", monospace;
  user-select: none;
  opacity: 0.8;
}
.email-domain {
  flex: 1 1 auto;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--ink);
  cursor: pointer;
  color: var(--ink);
  background: var(--panel-2);
  box-shadow: var(--shadow-sm);
  transition: transform 0.06s, box-shadow 0.06s;
}
.icon-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
}
.icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 var(--ink);
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 var(--ink);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-ghost {
  background: var(--panel);
  border-color: var(--ink);
}
.btn-soft {
  background: var(--panel-2);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-danger-ghost {
  background: var(--danger);
  border-color: var(--ink);
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
}
.domain-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--panel-2);
  color: var(--ink);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 0 40px 0 14px;
  height: 44px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.08s ease;
  /* custom brutalist chevron */
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: right 18px center, right 13px center;
  background-size: 6px 6px, 6px 6px;
}
.domain-select:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}
.domain-select:focus {
  outline: none;
  background-color: #fff;
}
.domain-select:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.domain-select option {
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
}

.custom-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.custom-input {
  flex: 1;
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-shadow: var(--shadow-sm);
}
.custom-input:focus {
  background: #fff;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}
@media (max-width: 560px) {
  .info-cards {
    grid-template-columns: 1fr;
  }
}
.info-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.info-card:nth-child(1) {
  background: #cfe0ff;
}
.info-card:nth-child(2) {
  background: var(--panel-2);
}
.info-card:nth-child(3) {
  background: #c9f7df;
}
.info-emoji {
  font-size: 22px;
}
.info-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
  font-weight: 800;
  text-transform: uppercase;
}
.info-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.4;
  font-weight: 500;
}

/* ---- inbox ---- */
.inbox-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inbox-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}
.inbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--accent);
  border: var(--border-w) solid var(--ink);
  padding: 4px 10px;
}
.dot-live {
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--ink);
  animation: pulse 1.6s steps(2, end) infinite;
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}
.message-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.message-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
}
.message-item.unseen {
  border-left: 8px solid var(--primary);
  background: #fffbe6;
}
.msg-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  background: var(--primary);
  border: var(--border-w) solid var(--ink);
}
.msg-main {
  flex: 1;
  min-width: 0;
}
.msg-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.msg-from {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 600;
}
.msg-subject {
  font-size: 14px;
  margin: 3px 0 2px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-preview {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-del {
  background: var(--panel);
  border: 2px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  padding: 3px 6px;
  border-radius: var(--radius);
  line-height: 1;
}
.msg-del:hover {
  color: #fff;
  background: var(--danger);
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  gap: 6px;
}
.empty-emoji {
  font-size: 52px;
}
.empty-state p {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
}
.empty-state small {
  max-width: 320px;
  line-height: 1.5;
  font-weight: 500;
}

/* ---- modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] {
  display: none;
}
/* the toast also uses [hidden] to stay out of the layout */
.toast[hidden] {
  display: none;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  width: 100%;
  max-width: 760px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 0 var(--ink);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: var(--border-w) solid var(--ink);
  background: var(--panel-2);
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}
.modal-meta {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: var(--border-w) solid var(--ink);
}
.meta-label {
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
}
.modal-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px;
}
.modal-attachments:empty {
  display: none;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: #cfe0ff;
  border: var(--border-w) solid var(--ink);
}
.attach-chip:hover {
  background: var(--primary);
  color: #fff;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 14.5px;
}
.modal-body :is(img) {
  max-width: 100%;
  height: auto;
}
.modal-body a {
  color: var(--primary);
  font-weight: 700;
}
.modal-body pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
}

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  border: var(--border-w) solid var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: var(--shadow);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-error {
  background: var(--danger);
  color: #fff;
}

/* ---- footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: var(--border-w) solid var(--ink);
  padding: 22px 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: var(--panel-2);
}
.site-footer .admin-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
}
.site-footer .admin-link:hover {
  background: var(--ink);
  color: var(--panel-2);
}

/* =====================================================
   Responsive — fluid across resize / breakpoints
   ===================================================== */

/* tablet & down: stack the grid, ease the spacing */
@media (max-width: 900px) {
  .container {
    padding: 0 16px;
  }
  .main-grid {
    gap: 18px;
    padding-top: 22px;
  }
  .inbox-panel {
    min-height: 380px;
  }
  .hero-sub {
    max-width: 60ch;
  }
}

/* large phones: center the header, full-width buttons */
@media (max-width: 620px) {
  .header-inner {
    justify-content: center;
    text-align: center;
  }
  .panel {
    padding: 18px 16px;
  }
  .action-row .btn,
  .custom-row .btn,
  .domain-select {
    flex: 1 1 100%;
    justify-content: center;
  }
  .custom-input {
    flex: 1 1 100%;
  }
  .inbox-head {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* small phones: tighten type and message rows */
@media (max-width: 420px) {
  .container {
    padding: 0 12px;
  }
  .email-input {
    font-size: 15px;
  }
  .inbox-head h2 {
    font-size: 20px;
  }
  .msg-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 16px;
  }
  .modal-meta,
  .modal-body {
    padding: 14px 16px;
  }
}

/* very wide screens: keep content from stretching too far */
@media (min-width: 1400px) {
  .container {
    max-width: 1280px;
  }
}

