@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=IBM+Plex+Mono:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --paper: #EEF2EF;
  --card: #FFFFFF;
  --ink: #14211C;
  --ink-soft: #4B5B54;
  --teal-deep: #0E4B45;
  --teal-mid: #1B7469;
  --teal-tint: #E4EEEC;
  --brass: #B8863C;
  --rule: #CBD5CE;
  --error: #B3432B;
  --radius: 14px;
  
  --clinic-navy: #0b2c3d;
  --clinic-navy-dark: #08212f;
  --clinic-teal: #0f5664;
  --clinic-coral: #ee5b54;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 480px at 15% -10%, #FFFFFF 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  .stub { animation: rise .5s ease-out both; }
  .stamp { animation: stamp .35s .25s cubic-bezier(.2, 1.4, .4, 1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes stamp { from { opacity: 0; transform: scale(1.4) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(-8deg); } }

.wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* ---- Header / wordmark ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.seal {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
}

.seal svg { width: 22px; height: 22px; }
.seal .logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.seal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.seal::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed var(--brass);
  opacity: .55;
  pointer-events: none;
}

.wordmark { line-height: 1.05; }
.wordmark .name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: .2px;
  color: var(--teal-deep);
}
.wordmark .name em { font-style: normal; color: var(--brass); }
.wordmark .role {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---- Ticket / stub card ---- */
.stub {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 33, 28, .04), 0 18px 40px -22px rgba(14, 75, 69, .35);
  overflow: hidden;
  border: 1px solid #E4E9E4;
}

.stub-top { padding: 26px 26px 22px; }
.stub-support { padding: 10px 26px 22px; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-mid);
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--ink);
}

.note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.field { margin-bottom: 16px; }

input[type="text"] {
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  letter-spacing: .06em;
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 9px;
  background: #FBFCFB;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]::placeholder { color: #9FAFA8; letter-spacing: .04em; }
input[type="text"]:focus {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px var(--teal-tint);
}
input[type="text"].err { border-color: var(--error); }

.hint { font-size: 12px; color: #7C8A83; margin-top: 6px; }
.hint.err { color: var(--error); }

.identity {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.photo {
  width: 76px;
  height: 96px;
  border-radius: 6px;
  background: var(--teal-tint);
  border: 1px solid var(--rule);
  flex: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo svg { width: 34px; height: 34px; color: var(--teal-mid); }

.id-fields dl { margin: 0; }
.id-fields .row { margin-bottom: 10px; }
.id-fields .row:last-child { margin-bottom: 0; }
.id-fields dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.id-fields dd {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14.5px;
  color: var(--ink);
  letter-spacing: .02em;
}
.id-fields .name-value {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .01em;
}

/* perforated divider, boarding-pass style */
.perf {
  position: relative;
  height: 0;
  border-top: 1.5px dashed var(--rule);
  margin: 4px 0 0;
}
.perf::before, .perf::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-radius: 50%;
}
.perf::before { left: -35px; }
.perf::after { right: -35px; }

.stub-bottom {
  padding: 24px 26px 26px;
  background: #FCFDFC;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.captcha-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  background: var(--teal-tint);
  color: var(--teal-deep);
  border-radius: 8px;
  padding: 10px 14px;
  letter-spacing: .03em;
  white-space: nowrap;
}
input#captchaAnswer, input#captchaAnswerRequest { max-width: 90px; text-align: center; }

.refresh {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.refresh:hover { background: var(--teal-tint); color: var(--teal-deep); }
.refresh svg { width: 17px; height: 17px; }

button[type="submit"] {
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 13px 16px;
  border: none;
  border-radius: 9px;
  background: var(--teal-deep);
  color: #F4F8F6;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
button[type="submit"]:hover { background: #0C3E39; }
button[type="submit"]:active { transform: translateY(1px); }
button[type="submit"]:disabled { background: #A9B6B0; cursor: not-allowed; }
button:focus-visible, input:focus-visible, .refresh:focus-visible {
  outline: 2px solid var(--teal-mid);
  outline-offset: 2px;
}

.status {
  font-size: 13px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
}
.status.show { display: block; }
.status.error { background: #FBEEEA; color: var(--error); }
.status.ok { background: var(--teal-tint); color: var(--teal-deep); }

.foot-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 18px;
  line-height: 1.6;
}
.foot-note a { color: var(--teal-deep); text-decoration: none; font-weight: 600; cursor: pointer; }
.foot-note a:hover { text-decoration: underline; }

.alertDiv {
  font-size: 13px;
  text-align: center;
  background: var(--teal-tint);
  color: var(--teal-deep);
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
  width: 100%;
}

/* ========================================================
   CLINICOS ADMIN LOGIN PAGE (Image 3)
   ======================================================== */
.clinicos-page {
  background-color: #edf2f6;
  background-image: 
    linear-gradient(to right, rgba(200, 215, 225, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200, 215, 225, 0.35) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.clinicos-card {
  width: 100%;
  max-width: 880px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(11, 44, 61, 0.1), 0 2px 10px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: row;
  min-height: 530px;
}

.clinicos-left-panel {
  width: 44%;
  background: linear-gradient(175deg, #0b2b3d 0%, #08212f 100%);
  color: #ffffff;
  padding: 42px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.clinicos-left-panel::after {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.clinicos-brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.clinicos-logo-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.clinicos-logo-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.clinicos-title-group h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: #ffffff;
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
}

.clinicos-title-group h1 span {
  color: var(--clinic-coral);
}

.clinicos-title-group p {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8da6b5;
  margin-top: 4px;
}

.clinicos-lead {
  font-size: 13.5px;
  line-height: 1.65;
  color: #c7d8e2;
  margin-bottom: 26px;
}

.clinicos-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0;
}

.clinicos-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #d8e5ed;
}

.clinicos-feature-list li::before {
  content: "●";
  color: var(--clinic-coral);
  font-size: 10px;
}

.clinicos-bottom-badge {
  font-size: 11px;
  color: #7995a5;
  letter-spacing: 0.3px;
}

.clinicos-right-panel {
  width: 56%;
  padding: 42px 44px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.login-form-header {
  margin-bottom: 24px;
}

.login-form-header h2 {
  font-size: 25px;
  font-weight: 700;
  color: #172b38;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.login-form-header p {
  font-size: 13px;
  color: #6b8291;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b9ea8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b9ea8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  z-index: 2;
}

.input-icon-right:hover {
  color: var(--clinic-teal);
}

.input-with-icon .form-control,
.input-with-icon input[type="text"],
.input-with-icon input[type="password"],
.clinicos-right-panel input[type="text"],
.clinicos-right-panel input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 10px 42px;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  border: 1.5px solid #d8e2e8;
  border-radius: 8px;
  color: #1c2b36;
  background: #ffffff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  line-height: normal;
}

.input-with-icon .form-control:focus,
.input-with-icon input[type="text"]:focus,
.input-with-icon input[type="password"]:focus,
.clinicos-right-panel input[type="text"]:focus,
.clinicos-right-panel input[type="password"]:focus {
  border-color: var(--clinic-teal);
  box-shadow: 0 0 0 3px rgba(15, 86, 100, 0.12);
}

.input-with-icon .form-control::placeholder,
.clinicos-right-panel input::placeholder {
  color: #9FAFA8;
  font-size: 13.5px;
}

.forgot-pass-wrap {
  text-align: right;
  margin-top: 4px;
  margin-bottom: 14px;
}

.forgot-pass-wrap a {
  font-size: 12px;
  color: #0f6f82;
  text-decoration: none;
  font-weight: 500;
}

.clinic-captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.clinic-captcha-badge {
  background-color: #0c3e4c;
  color: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.clinic-captcha-input,
.clinicos-right-panel input.clinic-captcha-input {
  flex: 1;
  height: 44px;
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  border: 1.5px solid #d8e2e8;
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #1c2b36;
}

.clinic-captcha-input:focus {
  border-color: var(--clinic-teal);
  box-shadow: 0 0 0 3px rgba(15, 86, 100, 0.12);
}

.btn-clinic-signin {
  width: 100%;
  height: 44px;
  background-color: var(--clinic-teal);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-clinic-signin:hover {
  background-color: #0b434e;
}

.clinic-login-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #f0f4f7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
}

.clinic-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7d93a1;
}

.clinic-footer-row a {
  color: #e55353;
  text-decoration: none;
  font-weight: 500;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #278c73;
  background: #e8f7f2;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ========================================================
   ADMIN DASHBOARD
   ======================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f4f7fa;
  font-family: 'IBM Plex Sans', sans-serif;
}

.admin-sidebar {
  width: 250px;
  background-color: #0a2738;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #a4bcc9;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.admin-nav-item.logout {
  color: #ff8c8c;
  margin-top: auto;
}

.admin-content {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.admin-topbar h1 {
  font-size: 24px;
  font-weight: 700;
  color: #112836;
  font-family: 'IBM Plex Sans', sans-serif;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  background: #ffffff;
  padding: 20px 22px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #e5edf2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info h4 {
  font-size: 12px;
  font-weight: 600;
  color: #6a8291;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #122f40;
}

.data-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5edf2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 30px;
}

.data-card-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf2f6;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background-color: #f8fafc;
  padding: 12px 20px;
  font-weight: 600;
  color: #556c7a;
  border-bottom: 1px solid #edf2f6;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f2f6f9;
  color: #273e4d;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.btn-outline {
  border-color: #cbd8e0;
  color: #3b5768;
  background: #ffffff;
}

.btn-danger {
  background-color: #ffeded;
  color: #d63031;
  border-color: #ffd2d2;
}

.btn-primary-admin {
  background-color: #0f5664;
  color: #ffffff;
}

.alert {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.alert-success { background-color: #e6f7ef; color: #116843; border: 1px solid #bcead3; }
.alert-error { background-color: #fdeeee; color: #b92020; border: 1px solid #f9cdcd; }

/* Responsive adjustments */
@media (max-width: 480px) {
  body { padding: 20px 12px; }
  .stub-top { padding: 22px 20px 18px; }
  .stub-bottom { padding: 20px 20px 22px; }
  .stub-support { padding: 10px 20px 20px; }
}

@media (max-width: 820px) {
  .clinicos-card { flex-direction: column; }
  .clinicos-left-panel, .clinicos-right-panel { width: 100%; padding: 28px 20px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-content { padding: 20px 14px; }
}
