@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/poppins-800.woff2") format("woff2");
}

:root {
  --accent: #0c59db;
  --accent-dark: #273272;
  --text: #748494;
  --heading: #151a33;
  --page: #edeef0;
  --border: #e7e7e7;
  --line: #d7dee8;
  --card: #fff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font-family: "Rubik", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.is-app {
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  z-index: 10;
}

.skip-link:focus {
  left: 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-width: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
}

.top .brand {
  flex: 0 0 auto;
}

.top-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand img {
  display: block;
  width: 210px;
  height: auto;
  filter: brightness(0);
}

.who {
  min-width: 0;
  flex: 1 1 auto;
  text-align: right;
}

.who strong {
  display: block;
  overflow: hidden;
  color: var(--heading);
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who span {
  font-size: 13px;
}

.nav {
  display: flex;
  gap: 8px 28px;
  flex-wrap: wrap;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}

.nav a {
  display: inline-block;
  padding: 14px 0 12px;
  color: var(--text);
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--heading);
  text-decoration: none;
}

.nav a.is-current {
  color: var(--heading);
  border-bottom-color: var(--accent-dark);
}

main {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 48px;
  flex: 1 0 auto;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 88px);
  min-height: calc(100dvh - 88px);
  padding-top: 24px;
  padding-bottom: 24px;
}

.sheet {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(21, 26, 51, 0.06);
}

.login-card {
  width: min(100%, 420px);
  padding: 36px 32px 32px;
}

.login-card .brand {
  display: block;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 16px;
  color: var(--heading);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 32px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--heading);
  padding: 12px 14px;
}

.field textarea {
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 14px;
}

.hint {
  display: block;
  margin: 0 0 14px;
  font-size: 13px;
}

.form-error {
  min-height: 1.4em;
  margin: 0 0 12px;
  color: #9d1c2b;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: "Rubik", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 22px;
  text-decoration: none;
}

.btn:hover {
  background: #0947b0;
  color: #fff;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-line {
  background: #fff;
  border-color: var(--line);
  color: var(--heading);
}

.btn-line:hover {
  background: var(--page);
  border-color: var(--accent-dark);
  color: var(--heading);
}

.help-link {
  margin-top: 12px;
}

.logout {
  flex: 0 0 auto;
  padding: 8px 14px;
  white-space: nowrap;
}

.agenda-date {
  margin-bottom: 22px;
  font-size: 28px;
}

.event {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 18px;
  margin-bottom: 12px;
  padding: 18px 20px;
}

.event time {
  color: var(--accent-dark);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

.event p {
  margin: 0;
  color: var(--heading);
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  min-width: 0;
}

.mail-side,
.mail-sheet,
.reader {
  min-width: 0;
  max-width: 100%;
}

.folder-toggle {
  display: none;
}

.folders {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
}

.folders a {
  border-left: 2px solid transparent;
  color: var(--text);
  padding: 8px 0 8px 12px;
  text-decoration: none;
}

.folders a:hover,
.folders a.is-current {
  color: var(--heading);
  text-decoration: none;
}

.folders a.is-current {
  border-left-color: var(--accent);
  font-weight: 600;
}

.mail-sheet {
  padding: 8px 8px 18px;
}

.mail-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 14px 12px;
  text-align: left;
}

.mail-row:hover {
  background: #f7f9fc;
}

.mail-row.is-unread .mail-from,
.mail-row.is-unread .mail-subject {
  color: var(--heading);
  font-weight: 600;
}

.mail-from,
.mail-subject {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-from {
  color: var(--heading);
}

.mail-subject {
  color: var(--text);
  font-size: 14px;
}

.mail-date {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.star,
.clip {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #c5ced8;
  stroke-width: 1.6;
}

.star.is-on {
  fill: var(--accent-dark);
  stroke: var(--accent-dark);
}

.reader {
  padding: 18px 22px 8px;
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 14px;
}

.reader h1 {
  font-size: 26px;
}

.sender {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 18px;
}

.sender > div {
  min-width: 0;
}

.sender img,
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--page);
}

.avatar {
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.sender strong {
  display: block;
  color: var(--heading);
  overflow-wrap: anywhere;
}

.sender span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mail-body {
  color: var(--heading);
  max-width: 100%;
  overflow-wrap: anywhere;
  padding-bottom: 12px;
}

.mail-body a,
.mail-body p,
.mail-body div,
.mail-body span,
.mail-body h8,
.mail-body h9 {
  overflow-wrap: anywhere;
}

.mail-body img,
.mail-body svg,
.mail-body video {
  max-width: 100%;
  height: auto;
}

.mail-body table {
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed;
}

.mail-body pre,
.mail-body code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-body h8,
.mail-body h9 {
  display: block;
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
}

.mail-body .respuesta {
  margin: 18px 0;
  border-left: 3px solid var(--line);
  padding-left: 16px;
}

.mail-body .remitente {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
}

.mail-body i {
  display: none;
}

.mail-body .social-media a.btn {
  display: none;
}

.empty {
  padding: 48px 16px 36px;
  text-align: center;
}

.empty img {
  width: 92px;
  margin-bottom: 8px;
}

.empty h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.site-footer {
  padding: 8px 16px 28px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

dialog {
  width: min(100% - 32px, 440px);
  min-width: 0;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--heading);
  padding: 0;
}

dialog::backdrop {
  background: rgba(21, 26, 51, 0.45);
}

.dialog-card {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 22px 22px 18px;
}

.dialog-card h2 {
  font-size: 20px;
}

.dialog-card p {
  margin: 0 0 18px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 760px) {
  .top,
  .nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top {
    flex-wrap: wrap;
  }

  .top .brand img {
    width: 120px;
  }

  .who strong {
    font-size: 13px;
  }

  .who span {
    display: none;
  }

  .logout {
    padding: 8px 10px;
    font-size: 13px;
  }

  main {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  #open-compose {
    width: 100%;
  }

  .folder-menu {
    position: relative;
  }

  .folder-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--heading);
    cursor: pointer;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    padding: 12px 14px;
    text-align: left;
  }

  .folder-toggle::after {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .folder-menu.is-open .folder-toggle::after {
    margin-top: 4px;
    transform: rotate(-135deg);
  }

  .folders {
    display: none;
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(21, 26, 51, 0.08);
    padding: 6px 0;
  }

  .folder-menu.is-open .folders {
    display: flex;
  }

  .folders a {
    border-left: 0;
    padding: 10px 14px;
    white-space: normal;
  }

  .folders a.is-current {
    background: var(--page);
    border-left: 0;
  }

  dialog {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .event {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 28px 20px 22px;
  }
}
