@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@600;700&display=swap');

:root {
  --bg: #f5f7f8;
  --paper: #ffffff;
  --off-white: #f4f6f6;

  --sidebar: #edf4f7;
  --hover: #dcecf1;

  --deep-teal: #0e3d44;
  --teal: #006d77;
  --blue-teal: #0a7c9e;
  --aqua: #44c5cc;

  --graphite: #1f2933;
  --text: #263238;
  --muted: #74808e;

  --line: #c9d8de;
  --line-soft: #edf2f4;

  --danger: #c84c48;
  --shadow: 0 18px 48px rgba(31, 41, 51, 0.09);
  --soft-shadow: 0 10px 28px rgba(31, 41, 51, 0.06);
}

/* DARK APP THEME */
body.dark {
  --app-bg: #101719;
  --app-topbar: #151f22;
  --app-card: #1d2c30;
  --app-card-soft: #22363b;
  --app-border: #33484e;
  --app-text: #e7eeee;
  --app-muted: #a7b8bc;
  --app-hover: #243f45;
  --app-teal: #4fb8c5;
}

body:not(.dark) {
  --app-bg: #f5f7f8;
  --app-topbar: #fcfdfd;
  --app-card: #f8fbfc;
  --app-card-soft: #edf4f7;
  --app-border: #c9d8de;
  --app-text: #263238;
  --app-muted: #5f6f76;
  --app-hover: #dcecf1;
  --app-teal: #006d77;
}

* {
  box-sizing: border-box;
}

.icon-logout {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-logout svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 84% 34%, rgba(68, 197, 204, 0.08), transparent 28%),
    linear-gradient(135deg, #ffffff, var(--off-white));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* =========================
   LANDING / LOGIN
========================= */

.page-shell {
  min-height: 100vh;
  padding: 24px 28px 12px;
}

.hero-card {
  position: relative;
  min-height: calc(100vh - 78px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.035);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-copy h1 {
  margin: 0;
  color: var(--graphite);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 30px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-copy p {
  margin: 5px 0 0;
  color: #7b8794;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
}

/* LOGO */

.logo-mark {
  position: relative;
  width: 68px;
  height: 58px;
  flex: 0 0 auto;
}

.logo-mark.mini-mark {
  width: 44px;
  height: 44px;
}

.corner {
  position: absolute;
  width: 24%;
  height: 24%;
  border-color: #59cbd1;
}

.corner.tl {
  top: 0;
  left: 0;
  border-top: 3px solid;
  border-left: 3px solid;
  border-radius: 0;
}

.corner.tr {
  top: 0;
  right: 0;
  border-top: 3px solid;
  border-right: 3px solid;
  border-radius: 0;
}

.corner.bl {
  bottom: 0;
  left: 0;
  border-bottom: 3px solid;
  border-left: 3px solid;
  border-radius: 0;
}

.corner.br {
  right: 0;
  bottom: 0;
  border-right: 3px solid;
  border-bottom: 3px solid;
  border-radius: 0;
}

.h-left,
.h-right,
.h-bar {
  position: absolute;
  display: block;
  border-radius: 0;
}

.h-left {
  left: 27%;
  top: 20%;
  width: 19%;
  height: 60%;
  background: #0e3d44;
}

.h-right {
  right: 27%;
  top: 20%;
  width: 19%;
  height: 60%;
  background: #1a7f8c;
}

.h-bar {
  left: 36%;
  top: 45%;
  width: 28%;
  height: 12%;
  background: linear-gradient(90deg, #0e3d44, #1a7f8c);
}

/* HERO */

.hero-main {
  position: relative;
  min-height: calc(100vh - 160px);
  padding: 112px 68px 120px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-copy h2 {
  margin: 0;
  color: #253244;
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: clamp(46px, 5vw, 76px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.hero-copy h2 span {
  display: block;
  color: #43bcc4;
}

.accent-line {
  width: 78px;
  height: 5px;
  margin: 30px 0 28px;
  border-radius: 999px;
  background: #43bcc4;
}

.hero-copy p {
  margin: 0;
  color: #707c89;
  font-size: 23px;
  line-height: 1.46;
  font-weight: 450;
}

/* ACCESS FORM */

.access-card {
  position: absolute;
  left: 68px;
  bottom: 42px;
  z-index: 3;

  display: flex;
  align-items: flex-end;
  gap: 12px;

  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.access-head {
  display: none;
}

.access-card label {
  display: block;
  width: 168px;
  margin: 0;
}

.access-card label span {
  display: block;
  margin-bottom: 6px;
  color: #687480;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.access-card input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(160, 178, 186, 0.55);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  color: var(--graphite);
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.045);
  backdrop-filter: blur(6px);
}

.access-card input:focus {
  border-color: rgba(67, 188, 196, 0.85);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(67, 188, 196, 0.11);
}

.login-button {
  width: 84px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #0e3d44, #1a7f8c);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(14, 61, 68, 0.14);
}

.login-error {
  position: absolute;
  left: 0;
  top: 58px;
  display: none;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.2;
}

.login-error.visible {
  display: block;
}

.landing-footer {
  padding: 14px 6px 0;
  text-align: center;
  color: #7f8a96;
  font-size: 13px;
}

/* =========================
   APP SCREEN
========================= */

.app-screen {
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.app-topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: var(--app-topbar);
  border-bottom: 1px solid var(--app-border);
}

.app-topbar .brand-copy h1 {
  color: var(--app-text);
  font-size: 24px;
}

.app-topbar .brand-copy p {
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 13px;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-button,
.logout-button {
  height: 40px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-card);
  color: var(--app-text);
  font-weight: 700;
}

.theme-button {
  width: 40px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.logout-button {
  padding: 0 16px;
}

.theme-button:hover,
.logout-button:hover {
  background: var(--app-hover);
}

.home-screen {
  max-width: 1140px;
  margin: 0 auto;
  padding: 44px 28px 64px;
}

.home-hero {
  margin-bottom: 26px;
}

.home-kicker {
  margin: 0 0 8px;
  color: var(--app-teal);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
}

.home-screen h2 {
  margin: 0;
  color: var(--app-text);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.home-hero p:last-child {
  margin: 12px 0 0;
  color: var(--app-muted);
  font-size: 16px;
}

.modality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px;
}

.modality-card {
  position: relative;
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 18px;
  text-align: left;

  border: 1px solid var(--app-border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, var(--app-card), var(--app-card-soft));
  color: var(--app-text);
  padding: 28px;
  box-shadow: 0 14px 35px rgba(14, 61, 68, 0.08);
  overflow: hidden;
}

body.dark .modality-card {
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.modality-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--deep-teal), var(--blue-teal), var(--aqua));
}

.modality-card:hover {
  border-color: var(--app-teal);
  transform: translateY(-1px);
}

.card-icon {
  width: 62px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(68, 197, 204, 0.13);
  color: var(--app-teal);
  font-weight: 850;
  letter-spacing: -0.02em;
}

.modality-card h3 {
  margin: 0 0 8px;
  color: var(--app-text);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.modality-card p {
  margin: 0;
  max-width: 420px;
  color: var(--app-muted);
  font-size: 15px;
  line-height: 1.5;
}

.card-status {
  position: absolute;
  left: 28px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--app-teal);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.card-status.muted {
  background: rgba(116, 128, 142, 0.16);
  color: var(--app-muted);
}

.disabled-card {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.7);
}

/* =========================
   US CATEGORIES SCREEN
========================= */

.us-screen {
  max-width: 1140px;
  margin: 0 auto;
  padding: 44px 28px 64px;
}

.section-header {
  margin-bottom: 26px;
}

.back-button {
  height: 40px;
  margin-bottom: 24px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-card);
  color: var(--app-text);
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(14, 61, 68, 0.05);
}

.back-button:hover {
  background: var(--app-hover);
}

.section-header h2 {
  margin: 0;
  color: var(--app-text);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-header p:last-child {
  margin: 12px 0 0;
  color: var(--app-muted);
  font-size: 16px;
}

.us-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.us-category-card {
  all: unset;
  box-sizing: border-box;
  position: relative;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--app-border);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--app-card), var(--app-card-soft));
  color: var(--app-text);
  padding: 22px;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(14, 61, 68, 0.08);
  overflow: hidden;
}

body.dark .us-category-card {
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.us-category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--deep-teal), var(--blue-teal), var(--aqua));
}

.us-category-card:hover {
  border-color: var(--app-teal);
  transform: translateY(-1px);
}

.us-category-card.active {
  border-color: var(--app-teal);
  background: linear-gradient(135deg, var(--app-hover), var(--app-card-soft));
}

.us-category-card h3 {
  margin: 0;
  color: var(--app-text);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.mask-panel {
  margin-top: 36px;
}

.mask-panel-head {
  margin-bottom: 16px;
  text-align: center;
}

.mask-panel-head h3 {
  margin: 0;
  color: var(--app-text);
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.mask-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.mask-card {
  all: unset;
  box-sizing: border-box;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--app-card), var(--app-card-soft));
  color: var(--app-text);
  padding: 16px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(14, 61, 68, 0.06);
}

body.dark .mask-card {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.mask-card:hover {
  border-color: var(--app-teal);
  background: var(--app-hover);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
  .page-shell {
    padding: 16px;
  }

  .topbar {
    min-height: 82px;
    height: auto;
    padding: 18px 22px;
  }

  .hero-main {
    min-height: 720px;
    padding: 78px 32px 48px;
  }

  .access-card {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: 42px;
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 420px);
    gap: 10px;
  }

  .access-card label {
    width: 100%;
  }

  .login-button {
    width: 100%;
  }

  .login-error {
    position: static;
    margin-top: 2px;
  }

  .us-category-grid {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }

  .mask-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 620px) {
  .brand {
    gap: 13px;
  }

  .logo-mark {
    width: 50px;
    height: 50px;
  }

  .brand-copy h1 {
    font-size: 28px;
  }

  .brand-copy p {
    font-size: 12px;
  }

  .hero-copy h2 {
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 18px;
  }

  .modality-grid,
  .us-category-grid,
  .mask-grid {
     grid-template-columns: 1fr;
  }
}

/* Subcategorias: Ginecológico / Obstétrico */
.subcategory-card {
  width: 230px;
  min-height: 104px;
  border-color: rgba(68, 197, 204, 0.38);
  background:
    linear-gradient(135deg, rgba(68, 197, 204, 0.13), rgba(255, 255, 255, 0.28));
  color: var(--app-text);

  font-size: 18px;
  font-weight: 800;
}

.mask-grid:has(.subcategory-card) {
  display: flex;
  justify-content: center;
  gap: 18px;
}

body.dark .subcategory-card {
  background:
    linear-gradient(135deg, rgba(79, 184, 197, 0.16), rgba(34, 54, 59, 0.94));
  border-color: rgba(79, 184, 197, 0.38);
}