:root {
  --bg: #fff8f2;
  --panel: #ffffff;
  --panel-soft: #fffaf4;
  --text: #243040;
  --muted: #6d7280;
  --line: #eadfce;
  --primary: #e45f7b;
  --primary-strong: #c83f61;
  --accent: #208a83;
  --sidebar: #2f3f55;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button,
input,
select {
  max-width: 100%;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(36, 48, 64, 0.78), rgba(36, 48, 64, 0.48)),
    url("https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  width: min(960px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-copy {
  display: grid;
  align-content: center;
  padding: clamp(32px, 6vw, 64px);
  background:
    linear-gradient(140deg, rgba(47, 63, 85, 0.94), rgba(43, 83, 91, 0.9));
  color: #ffffff;
}

.login-copy h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 1;
}

.login-copy p {
  max-width: 480px;
}

.address-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}

.address-showcase span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff7ed;
  font-size: 0.9rem;
  font-weight: 800;
}

.hero-points {
  display: grid;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}

.hero-points li {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.94rem;
  font-weight: 700;
}

.hero-points li::before {
  position: absolute;
  top: 0.64em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4a261;
  content: "";
}

.hero-help-button {
  width: fit-content;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 750;
}

.hero-help-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.login-form,
.form-card {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.auth-card {
  display: grid;
  align-content: start;
  background: var(--panel);
}

.legal-links,
.global-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.legal-links {
  padding: 0 28px 22px;
}

.legal-links button,
.global-legal-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.legal-links button:hover,
.global-legal-links button:hover {
  color: var(--primary);
  text-decoration: underline;
}

.global-legal-links {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 4;
  justify-content: flex-end;
  max-width: min(520px, calc(100% - 36px));
  padding: 8px 10px;
  border: 1px solid rgba(221, 215, 204, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.1);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 16px 16px 0;
}

.auth-tab {
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 750;
}

.auth-tab + .auth-tab {
  border-left: 0;
}

.auth-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.link-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 750;
  text-align: left;
}

.link-button:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.otp-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.otp-step {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.otp-step.active {
  border-color: var(--primary);
  background: #fff0f4;
  color: var(--primary-strong);
}

.otp-panel {
  display: grid;
  gap: 16px;
}

.otp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.login-form h2,
.form-card h2,
.settings-section h2,
.activity-list h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 750;
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.form-note,
.generated-address,
.form-card p,
.settings-section p,
.metric-card p {
  margin: 0;
  color: var(--muted);
}

.generated-address {
  padding: 10px 12px;
  border: 1px solid #f6c5d1;
  border-radius: 8px;
  background: #fff4f7;
}

.generated-address strong {
  color: var(--primary-strong);
}

.generated-address.invalid {
  border-color: #f3b8b2;
  background: #fff1f0;
  color: #b42318;
}

.generated-address.invalid strong {
  color: #b42318;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--sidebar);
  color: #f8fafc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #f4a261;
  color: #17212b;
  font-weight: 900;
}

.brand-name,
.brand-domain {
  margin: 0;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 850;
}

.brand-domain,
.account-card p {
  color: #cbd5e1;
  font-size: 0.88rem;
}

.folder-nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.folder-count {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  text-align: center;
}

.account-card {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.account-card p {
  margin: 0;
}

.account-card button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
}

.main-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow,
.topbar h1 {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: 1.8rem;
  line-height: 1.2;
}

.search {
  flex: 1;
  max-width: 520px;
}

.view-panel {
  padding: 28px;
}

.simple-home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-card,
.plan-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.home-card strong,
.plan-card strong {
  font-size: 1.9rem;
  line-height: 1.15;
}

.home-label {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
}

.home-card p,
.plan-card p {
  margin: 0;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.quick-actions button {
  flex: 0 1 auto;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 560px);
  gap: 18px;
  align-items: start;
}

.plan-list {
  display: grid;
  gap: 14px;
}

.plan-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.payment-card {
  width: 100%;
}

.checkout-summary {
  display: grid;
  gap: 10px;
}

.checkout-summary div {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.checkout-summary span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.checkout-summary strong {
  color: var(--text);
}

.billing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.settings-section,
.activity-list,
.form-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 20px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.metric-card strong {
  font-size: 2.2rem;
  line-height: 1;
}

.settings-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 22px;
}

.activity-list {
  margin-top: 16px;
  padding: 22px;
}

.activity-list ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.activity-list span {
  color: var(--accent);
  font-weight: 800;
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: 0;
  padding: 0;
}

.message-list {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
}

.message-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.message-card:hover,
.message-card.selected {
  background: #ffffff;
}

.message-card.unread .message-subject {
  font-weight: 850;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.message-from {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-subject,
.message-preview {
  margin: 0;
}

.message-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff0f4;
  color: #c83f61;
  font-size: 0.76rem;
  font-weight: 700;
}

.reading-pane {
  min-width: 0;
  overflow: auto;
  padding: clamp(22px, 4vw, 44px);
  background: var(--panel);
}

.detail-header {
  display: grid;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1.15;
}

.sender-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.sender {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff0f4;
  color: var(--primary-strong);
  font-weight: 800;
}

.forwarding-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}

.detail-body {
  max-width: 760px;
  padding-top: 24px;
  font-size: 1.03rem;
}

.detail-body p {
  margin: 0 0 18px;
}

.empty-state {
  display: grid;
  min-height: 60vh;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.form-card {
  width: min(720px, 100%);
}

.form-card form {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17212b;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 840px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.faq-list summary {
  padding: 16px 18px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.faq-modal {
  width: min(720px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.faq-modal::backdrop {
  background: rgba(15, 23, 42, 0.44);
}

.faq-modal-inner {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.compose-header h2 {
  margin: 0;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 1.25rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .login-panel,
  .app-shell,
  .mail-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 14px;
    padding: 14px 16px;
  }

  .folder-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-button {
    min-width: 148px;
    grid-template-columns: 20px 1fr auto;
    white-space: nowrap;
  }

  .account-card {
    display: none;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .simple-home,
  .billing-layout {
    grid-template-columns: 1fr;
  }

  .message-list {
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .login-screen {
    align-items: stretch;
    padding: 10px;
  }

  .login-panel {
    align-self: center;
    width: 100%;
    max-width: 460px;
  }

  .login-copy {
    padding: 28px 22px;
  }

  .login-copy h1 {
    font-size: 3.4rem;
  }

  .login-form,
  .form-card,
  .view-panel {
    padding: 20px 16px;
  }

  .topbar,
  .settings-section,
  .sender-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 20px 16px 14px;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-domain {
    overflow: hidden;
    max-width: 230px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .simple-home,
  .plan-list {
    gap: 12px;
  }

  .home-card,
  .plan-card {
    padding: 18px;
  }

  .home-card strong,
  .plan-card strong {
    font-size: 1.55rem;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-actions button,
  .billing-layout button,
  .form-card button {
    width: 100%;
  }

  .billing-actions {
    grid-template-columns: 1fr;
  }

  .reading-pane {
    padding: 22px 16px 32px;
  }

  .auth-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .auth-tab {
    border-radius: 8px;
    border: 1px solid var(--line);
    min-height: 44px;
  }

  .auth-tab + .auth-tab {
    border-left: 1px solid var(--line);
  }

  .otp-steps {
    grid-template-columns: 1fr 1fr;
  }

  .otp-actions {
    display: grid;
    gap: 10px;
  }

  .message-list {
    max-height: 48vh;
  }

  .message-card {
    padding: 16px;
  }

  .sender {
    align-items: flex-start;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .login-screen {
    padding: 0;
  }

  .login-panel {
    min-height: 100dvh;
    border-radius: 0;
  }

  .login-copy {
    min-height: 220px;
  }

  .login-copy h1 {
    font-size: 3rem;
  }

  .auth-card {
    align-content: start;
  }

  .auth-tabs {
    padding: 12px 12px 0;
  }

  .login-form {
    padding: 18px 12px 24px;
  }

  .legal-links {
    padding: 0 12px 18px;
  }

  .global-legal-links {
    right: 8px;
    bottom: 8px;
    left: 8px;
    justify-content: center;
    max-width: none;
  }

  .sidebar {
    padding: 12px;
  }

  .nav-button {
    min-width: 138px;
  }

  .view-panel,
  .reading-pane,
  .form-card {
    padding-right: 12px;
    padding-left: 12px;
  }

  .topbar {
    padding-right: 12px;
    padding-left: 12px;
  }
}
