/* =====================================================
   Temp Mail — modern UI styling
   ===================================================== */
:root {
  --bg: #0b1020;
  --bg-soft: #121a32;
  --panel: rgba(22, 30, 56, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e9edf7;
  --text-dim: #9aa6c4;
  --primary: #5b8cff;
  --primary-2: #7c5bff;
  --accent: #34e0a1;
  --danger: #ff5d6c;
  --warning: #ffb13d;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 10% -10%,
      #1b2547 0%,
      transparent 60%
    ),
    radial-gradient(1000px 500px at 110% 10%, #271a4a 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- animated background orbs ---- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.55;
}
.orb {
  position: absolute;
  border-radius: 50%;
  animation: float 16s ease-in-out infinite;
}
.orb-1 {
  width: 360px;
  height: 360px;
  background: #3b62ff;
  top: -80px;
  left: -60px;
}
.orb-2 {
  width: 300px;
  height: 300px;
  background: #7c3bff;
  right: -40px;
  top: 120px;
  animation-delay: -4s;
}
.orb-3 {
  width: 320px;
  height: 320px;
  background: #1f9c6b;
  bottom: -120px;
  left: 40%;
  animation-delay: -8s;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(40px) translateX(20px);
  }
}

/* ---- header ---- */
.site-header {
  position: relative;
  z-index: 2;
  padding: 18px 0;
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
}
.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;
  filter: drop-shadow(0 4px 10px rgba(91, 140, 255, 0.5));
}
.brand-text strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand-text small {
  color: var(--text-dim);
  font-size: 12px;
}

/* ---- 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: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
}
.badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}
.badge-approved {
  color: var(--accent);
  border-color: rgba(52, 224, 161, 0.35);
  background: rgba(52, 224, 161, 0.08);
}
.badge-checking {
  color: var(--warning);
  border-color: rgba(255, 177, 61, 0.35);
  background: rgba(255, 177, 61, 0.08);
}
.badge-disconnected {
  color: var(--danger);
  border-color: rgba(255, 93, 108, 0.35);
  background: rgba(255, 93, 108, 0.08);
}
.badge-checking .dot {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ---- layout ---- */
.main-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 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: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ---- hero / address ---- */
.hero-title {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  background: linear-gradient(90deg, #fff, #b9c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.email-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
}
.email-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s, transform 0.1s;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.icon-btn:active {
  transform: scale(0.94);
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.1s, filter 0.2s, background 0.2s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(91, 140, 255, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--panel-border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-soft {
  background: rgba(91, 140, 255, 0.16);
  border-color: rgba(91, 140, 255, 0.3);
  color: #cdd9ff;
}
.btn-soft:hover {
  background: rgba(91, 140, 255, 0.26);
}
.btn-danger-ghost {
  background: rgba(255, 93, 108, 0.12);
  border-color: rgba(255, 93, 108, 0.3);
  color: #ff9aa4;
  padding: 8px 13px;
  font-size: 13px;
}
.btn-danger-ghost:hover {
  background: rgba(255, 93, 108, 0.2);
}
.domain-select {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
}

.custom-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.custom-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.custom-input:focus {
  border-color: var(--primary);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}
@media (max-width: 560px) {
  .info-cards {
    grid-template-columns: 1fr;
  }
}
.info-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
}
.info-emoji {
  font-size: 22px;
}
.info-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.info-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---- 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: 22px;
}
.inbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(52, 224, 161, 0.12);
  animation: pulse 1.6s ease-in-out infinite;
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}
.message-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.18s, transform 0.1s, border-color 0.2s;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.message-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(91, 140, 255, 0.4);
}
.message-item.unseen {
  border-left: 3px solid var(--primary);
}
.msg-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.msg-main {
  flex: 1;
  min-width: 0;
}
.msg-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.msg-from {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.msg-subject {
  font-size: 14px;
  margin: 3px 0 2px;
  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: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 8px;
}
.msg-del:hover {
  color: var(--danger);
  background: rgba(255, 93, 108, 0.12);
}

.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;
  opacity: 0.8;
}
.empty-state p {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.empty-state small {
  max-width: 320px;
  line-height: 1.5;
}

/* ---- modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 7, 18, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s 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(--bg-soft);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--panel-border);
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
}
.modal-meta {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--panel-border);
}
.meta-label {
  color: var(--text);
  font-weight: 600;
}
.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: 10px;
  font-size: 12.5px;
  text-decoration: none;
  color: #cdd9ff;
  background: rgba(91, 140, 255, 0.14);
  border: 1px solid rgba(91, 140, 255, 0.3);
}
.attach-chip:hover {
  background: rgba(91, 140, 255, 0.24);
}
.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);
}
.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: #1c2748;
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-error {
  border-color: rgba(255, 93, 108, 0.5);
  color: #ff9aa4;
}

/* ---- footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--panel-border);
  padding: 22px 0;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}
