@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --canvas: #111210;
  --canvas-2: #1a1b18;
  --panel: #fbfaf6;
  --panel-strong: #ffffff;
  --panel-soft: #f4f1ea;
  --ink: #141512;
  --ink-soft: #343832;
  --muted: #73766d;
  --line: #ded8cc;
  --line-strong: #b9ad96;
  --night: #080908;
  --glass: rgba(16, 17, 15, 0.72);
  --champagne: #c5a45e;
  --champagne-strong: #96763a;
  --emerald: #153c35;
  --wine: #3d2024;
  --danger: #b42318;
  --success: #157347;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 14px 38px rgba(30, 27, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(12, 12, 10, 0.86), rgba(23, 23, 20, 0.92)),
    url("cocktail-roof-bg.jpg") center / cover fixed no-repeat,
    var(--canvas);
  color: var(--ink);
  font-family: "Manrope", Aptos, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  appearance: none;
}

h1,
h2,
p {
  margin-top: 0;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 28% 28%, rgba(197, 164, 94, 0.34), transparent 34%),
    linear-gradient(90deg, rgba(5, 5, 4, 0.90), rgba(13, 14, 12, 0.66) 45%, rgba(5, 5, 4, 0.92)),
    url("cocktail-roof-bg.jpg") center / cover no-repeat,
    var(--night);
}

.login-shell {
  width: min(100%, 468px);
}

.login-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(223, 211, 184, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 20, 18, 0.90), rgba(8, 9, 8, 0.90)),
    rgba(8, 9, 8, 0.90);
  color: #fbf8ef;
  padding: 34px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 18% 0%, rgba(197, 164, 94, 0.20), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%);
}

.login-panel > * {
  position: relative;
}

.login-logo-wrap {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.brand-badge {
  display: block;
  object-fit: contain;
}

.brand-badge-large {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.38));
}

.brand-badge-small {
  width: 42px;
  height: 42px;
}

.brand-script {
  display: block;
  object-fit: contain;
}

.brand-script-large {
  width: min(286px, 76vw);
  max-height: 74px;
  filter: drop-shadow(0 9px 20px rgba(0, 0, 0, 0.36));
}

.brand-script-small {
  width: 118px;
  height: 28px;
  object-position: left center;
}

.eyebrow {
  margin: 26px 0 8px;
  color: #d8bd7a;
  font-weight: 800;
}

.login-panel h1 {
  margin-bottom: 28px;
  color: #ffffff;
  font-family: "Fraunces", Georgia, serif;
  font-size: 38px;
  line-height: 1.04;
}

.login-form,
.compose-form,
.settings-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.login-panel label {
  color: rgba(251, 248, 239, 0.78);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.login-panel input {
  border-color: rgba(223, 211, 184, 0.34);
  background: rgba(255, 255, 255, 0.94);
}

textarea {
  resize: vertical;
  line-height: 1.58;
}

input:focus,
textarea:focus {
  border-color: var(--champagne);
  box-shadow: 0 0 0 3px rgba(197, 164, 94, 0.18);
}

.primary-button,
.secondary-button,
.compose-link,
.account-link,
.logout-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 11px 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  text-align: center;
}

.primary-button,
.compose-link {
  border: 1px solid rgba(234, 210, 145, 0.36);
  background: linear-gradient(180deg, #c6a766, #89662f);
  color: #12110e;
  box-shadow: 0 15px 28px rgba(95, 68, 27, 0.28);
}

.primary-button:hover,
.compose-link:hover {
  background: linear-gradient(180deg, #d8b976, #785726);
}

.secondary-button,
.account-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  box-shadow: none;
}

.secondary-button:hover,
.account-link:hover,
.account-link.active {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #17130d;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.notice-error {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.26);
  background: #fff5f2;
}

.notice-success {
  color: var(--success);
  border-color: rgba(21, 115, 71, 0.24);
  background: #f0fff6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(223, 211, 184, 0.18);
  background:
    radial-gradient(circle at 18% 16%, rgba(197, 164, 94, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(8, 9, 8, 0.88), rgba(8, 9, 8, 0.96)),
    url("cocktail-roof-bg.jpg") 22% center / cover no-repeat,
    var(--night);
  color: #fbf8ef;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 22px;
}

.brand-row span {
  display: block;
  color: rgba(251, 248, 239, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.folder-list {
  display: grid;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(223, 211, 184, 0.18);
}

.folder-list a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(251, 248, 239, 0.72);
}

.folder-list a:hover,
.folder-list a.active {
  border-color: rgba(223, 211, 184, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.folder-list a.active::before {
  content: "";
  width: 3px;
  height: 18px;
  margin-right: 9px;
  border-radius: 3px;
  background: var(--champagne);
}

.mail-shell {
  min-width: 0;
  padding: 18px;
  background:
    radial-gradient(circle at 82% 0%, rgba(197, 164, 94, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(244, 241, 234, 0.90), rgba(226, 224, 216, 0.86));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.search-form {
  flex: 1;
  min-width: 0;
}

.search-form input {
  min-height: 44px;
  border-color: rgba(185, 173, 150, 0.74);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.account-pill {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 13px;
  border: 1px solid rgba(185, 173, 150, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.account-pill span {
  max-width: 230px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.logout-link {
  min-height: 34px;
  border: 1px solid #11110f;
  background: #11110f;
  color: #ffffff;
  padding: 8px 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(500px, 1.24fr);
  gap: 18px;
  align-items: start;
}

.content-grid:not(.has-reader) {
  grid-template-columns: minmax(340px, 1fr) minmax(360px, 0.82fr);
}

.content-grid.utility-grid {
  grid-template-columns: minmax(0, 1120px);
}

.message-list,
.reader {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(185, 173, 150, 0.72);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.96);
  box-shadow: var(--shadow);
}

.message-list {
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

.list-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f6f2ea);
}

.list-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  line-height: 1.15;
}

.list-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--champagne-strong);
  font-size: 21px;
  font-weight: 900;
}

.icon-button:hover {
  border-color: var(--line-strong);
}

.rows {
  display: grid;
}

.mail-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.mail-row:hover,
.mail-row.selected {
  background: #f4eee2;
}

.mail-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--champagne);
}

.mail-row.unread {
  background: #ffffff;
}

.sender-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: linear-gradient(145deg, #10110f, #26382f);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-copy strong,
.row-copy span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.row-copy span {
  color: var(--muted);
}

.unread .row-copy span,
.unread .row-copy strong {
  color: var(--ink);
  font-weight: 900;
}

.row-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.empty-state,
.empty-reader {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.reader {
  min-height: calc(100vh - 104px);
  padding: 24px;
}

.reader-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-head h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 29px;
  line-height: 1.16;
}

.reader-head dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.reader-head dl div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
}

.reader-head dt {
  color: var(--muted);
  font-weight: 900;
}

.reader-head dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.mail-body {
  margin: 0;
  padding: 0;
  color: #1f211d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.68;
}

.attachments {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.attachments h2 {
  font-size: 17px;
}

.attachment {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.attachment small {
  color: var(--muted);
}

.mail-editor,
.settings-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(197, 164, 94, 0.58);
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0.96), rgba(244, 241, 234, 0.94)),
    var(--panel);
}

.mail-editor::before,
.settings-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 164px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 9, 8, 0.88), rgba(8, 9, 8, 0.48), rgba(8, 9, 8, 0.84)),
    url("cocktail-roof-bg.jpg") center 38% / cover no-repeat;
}

.mail-editor > *,
.settings-panel > * {
  position: relative;
}

.compose-head,
.settings-head {
  min-height: 116px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -24px 22px;
  padding: 24px;
  border-bottom: 1px solid rgba(197, 164, 94, 0.36);
  color: #ffffff;
}

.compose-head span {
  display: block;
  margin-bottom: 7px;
  color: #d8bd7a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.compose-head h1,
.settings-head h1 {
  margin-bottom: 0;
  color: #ffffff;
  font-family: "Fraunces", Georgia, serif;
  font-size: 30px;
  line-height: 1.12;
}

.settings-head p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.70);
  line-height: 1.45;
}

.compose-head-logo {
  width: min(220px, 34vw);
  max-height: 58px;
  object-fit: contain;
  object-position: right top;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.34));
}

.compose-editor-grid,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 18px;
  align-items: start;
}

.compose-fields,
.settings-fields {
  display: grid;
  gap: 16px;
}

.compose-panel label span,
.settings-form label span {
  color: var(--ink-soft);
}

.compose-from {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(197, 164, 94, 0.34);
  border-left: 4px solid var(--champagne);
  border-radius: 8px;
  background: linear-gradient(90deg, #fffaf0, #ffffff);
  padding: 13px 14px;
}

.compose-from span {
  color: var(--champagne-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.compose-from strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.compose-panel textarea[name="body"] {
  height: 270px;
  min-height: 230px;
  max-height: 480px;
}

.signature-preview-card {
  overflow: hidden;
  border: 1px solid rgba(197, 164, 94, 0.46);
  border-radius: 8px;
  background: #11110f;
  color: #fbf8ef;
  box-shadow: var(--shadow-soft);
}

.signature-preview-card.is-compact {
  position: sticky;
  top: 18px;
}

.signature-banner {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(197, 164, 94, 0.30), transparent 34%),
    linear-gradient(180deg, rgba(12, 12, 10, 0.50), rgba(12, 12, 10, 0.88)),
    url("cocktail-roof-bg.jpg") center / cover no-repeat;
  border-bottom: 1px solid rgba(197, 164, 94, 0.32);
}

.signature-banner img {
  width: 210px;
  max-width: 88%;
  max-height: 62px;
  object-fit: contain;
}

.signature-body {
  display: grid;
  gap: 7px;
  padding: 15px;
}

.signature-body span {
  color: #d8bd7a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.signature-body strong {
  color: #ffffff;
  font-size: 16px;
}

.signature-body small,
.signature-body p {
  margin: 0;
  color: rgba(251, 248, 239, 0.66);
}

.signature-body pre {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(197, 164, 94, 0.20);
  color: rgba(251, 248, 239, 0.82);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
  min-width: 148px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #ffffff;
}

.pager a,
.pager span {
  color: var(--muted);
  font-weight: 900;
}

.pager a:not(.disabled) {
  color: var(--champagne-strong);
}

.pager .disabled {
  opacity: 0.36;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .compose-editor-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .signature-preview-card.is-compact {
    position: static;
  }
}

@media (max-width: 1100px) {
  .content-grid,
  .content-grid:not(.has-reader),
  .content-grid.utility-grid {
    grid-template-columns: 1fr;
  }

  .message-list,
  .reader {
    min-height: auto;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(223, 211, 184, 0.18);
  }

  .brand-row {
    margin-bottom: 16px;
  }

  .sidebar-actions,
  .folder-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .folder-list {
    padding-top: 14px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .login-page {
    padding: 16px;
  }

  .login-panel {
    padding: 24px;
  }

  .login-panel h1 {
    font-size: 32px;
  }

  .mail-shell,
  .sidebar {
    padding: 14px;
  }

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

  .account-pill {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .mail-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .sender-avatar {
    width: 38px;
    height: 38px;
  }

  .row-meta {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }

  .reader {
    padding: 18px;
  }

  .compose-head,
  .settings-head {
    margin: -18px -18px 18px;
    padding: 18px;
    flex-direction: column;
  }

  .compose-head-logo {
    width: 190px;
    max-width: 80%;
  }

  .compose-panel textarea[name="body"] {
    height: 240px;
  }

  .reader-head h1,
  .compose-head h1,
  .settings-head h1 {
    font-size: 24px;
  }

  .reader-head dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .primary-button,
  .form-actions .secondary-button {
    width: 100%;
  }
}
