/* ============================================================
   CLÍNICA EDRIA — Patient View Styles
   ============================================================ */

/* ── Login screen wrapper ─────────────────────────────────── */

.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background: var(--white);
  padding: 40px 0 60px;
}

/* ── Patient shell (mobile-first column container) ────────── */

.patient-shell {
  width: 100%;
  max-width: var(--mobile-max);
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 48px rgba(26, 26, 26, 0.07), 0 2px 8px rgba(26, 26, 26, 0.04);
  padding-bottom: 100px;
  min-height: 100vh;
}

/* ── Login logo ───────────────────────────────────────────── */

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
}

.login-logo img {
  max-width: 120px;
  height: auto;
}

.login-logo-fallback {
  align-items: center;
  justify-content: center;
}

/* ── Gold divider ─────────────────────────────────────────── */

.login-divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 20px;
}

/* ── Login subtitle ───────────────────────────────────────── */

.login-subtitle {
  font-family: var(--font-elegant);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gray);
  text-align: center;
  margin-bottom: 32px;
}

/* ── Login form ───────────────────────────────────────────── */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 28px;
}

/* ── Login footer (forgot password link) ─────────────────── */

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding: 0 28px;
}

.login-footer a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--gray);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: var(--gold);
}

/* ── Dashboard header ─────────────────────────────────────── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-border);
}

.dash-header-logo {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--black);
  text-transform: uppercase;
}

.dash-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Dashboard greeting ───────────────────────────────────── */

.dash-greeting {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--black);
  padding: 28px 24px 8px;
}

.dash-greeting em {
  font-style: italic;
  color: var(--gold);
}

/* ── Plan badge ───────────────────────────────────────────── */

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--beige);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin: 0 24px 24px;
}

/* ── Modules grid ─────────────────────────────────────────── */

.modules-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
}

/* ── Module card ──────────────────────────────────────────── */

.module-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.module-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ── Module icon ──────────────────────────────────────────── */

.module-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--beige);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--gold);
  transition: var(--transition);
}
.module-icon svg {
  width: 22px;
  height: 22px;
}

.module-card:hover .module-icon {
  background: var(--gold-gradient);
  color: white;
}

/* ── Module info ──────────────────────────────────────────── */

.module-info {
  flex: 1;
  min-width: 0;
}

.module-info h3 {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-info p {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--gray);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Module arrow ─────────────────────────────────────────── */

.module-arrow {
  flex-shrink: 0;
  color: var(--gray-light);
  transition: color 0.25s ease, transform 0.25s ease;
}

.module-card:hover .module-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

/* ── Bottom navigation ────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--mobile-max);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray-border);
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gray);
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--gold);
}

/* ── FAQ section ──────────────────────────────────────────── */

.faq-section {
  padding: 0 24px;
  margin-top: 8px;
}

.faq-item {
  border-bottom: 1px solid var(--gray-border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--black);
  gap: 12px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--gray);
  transition: transform 0.3s ease, color 0.3s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 0 16px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ── Appointment / cita buttons ───────────────────────────── */

.cita-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
  margin-top: 8px;
}

.cita-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-border);
  background: var(--white);
  cursor: pointer;
  text-decoration: none;
  color: var(--black);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.cita-btn:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.cita-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.cita-btn-icon.doctoralia {
  background: #00B0B9;
  color: var(--white);
}

.cita-btn-icon.whatsapp {
  background: #25D366;
  color: var(--white);
}

.cita-btn-icon.phone {
  background: var(--gold-gradient);
  color: var(--white);
}

.cita-btn-icon.linktree {
  background: #39E09B;
  color: var(--white);
}

/* ── Module view (single module page) ────────────────────── */

.module-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--white);
  max-width: var(--mobile-max);
  margin: 0 auto;
}

.module-view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-border);
  background: transparent;
  color: var(--black);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.back-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.module-view-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
}

/* ── Video container (16/9 aspect ratio) ─────────────────── */

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: var(--black);
  overflow: hidden;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.module-view-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Dose Calendar ───────────────────────────────────────────── */

.calendar-container {
  padding: 20px 24px 32px;
  background: var(--white);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-month-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--black);
  letter-spacing: 0.02em;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-border);
  background: transparent;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.calendar-nav:hover {
  border-color: var(--gold);
  background: var(--beige-light);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-name {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  text-align: center;
  padding-bottom: 8px;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 50%;
  cursor: default;
  transition: all 0.25s ease;
  user-select: none;
}

.calendar-day-number {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--black);
  line-height: 1;
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.other-month .calendar-day-number {
  color: var(--gray);
}

.calendar-day.today {
  border: 1.5px solid var(--gold);
}

.calendar-day.dose-day {
  background: var(--beige);
  cursor: pointer;
}

.calendar-day.dose-day .calendar-day-number {
  color: var(--gold);
  font-weight: 700;
}

.calendar-day.dose-day:hover {
  background: var(--gold-pale);
  transform: scale(1.08);
}

.calendar-day.completed {
  background: var(--gold-gradient);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(184, 150, 78, 0.3);
}

.calendar-day.completed .calendar-day-number {
  color: var(--white);
  font-weight: 700;
}

.calendar-day.completed:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(184, 150, 78, 0.4);
}

.dose-check {
  position: absolute;
  bottom: 2px;
  font-size: 0.55rem;
  color: var(--white);
  line-height: 1;
}

.calendar-day.future-dose {
  border: 1.5px dashed var(--gold-light);
  cursor: pointer;
}

.calendar-day.future-dose .calendar-day-number {
  color: var(--gold-light);
  font-weight: 600;
}

.calendar-day.future-dose:hover {
  background: var(--beige-light);
}

/* ── Dose info card ──────────────────────────────────────────── */

.dose-info {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--beige-light);
  border-radius: var(--radius);
  border: 1px solid var(--beige);
}

.dose-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dose-next-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
}

.dose-next-date {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
}

/* ── Dose day selector ───────────────────────────────────────── */

.dose-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--beige-light);
  border-radius: var(--radius);
  border: 1px solid var(--beige);
}

.dose-selector-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black);
}

.dose-selector-select {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--black);
  background: var(--white);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23B8964E' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.dose-selector-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 78, 0.15);
}

/* ── MFA Screens ─────────────────────────────────────────── */

.mfa-qr-container {
  text-align: center;
  margin: 24px 0;
}
.mfa-qr-container img {
  width: 200px;
  height: 200px;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius);
  margin: 0 auto;
}
.mfa-secret {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--gray);
  background: var(--beige);
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  margin: 12px 0;
  word-break: break-all;
}
.mfa-code-input {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 0.5em;
  padding: 16px;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  color: var(--black);
  background: var(--beige-light);
  transition: var(--transition);
}
.mfa-code-input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(184, 150, 78, 0.1);
}
.mfa-instructions {
  font-size: 0.82rem;
  color: var(--gray);
  text-align: center;
  line-height: 1.6;
  margin: 16px 0;
}
