/* ==========================================================================
   INTEGROMED | MEDCORE — Authentication Gate
   Frontend-only demonstration. No backend, no real credential storage.
   Server-authenticated access
   ========================================================================== */

/* The `hidden` attribute must win over any component display rule. */
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #070b13;
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  overflow-x: hidden;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 3rem 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(1100px 620px at 12% 8%, rgba(3, 105, 161, .5), transparent 62%),
    radial-gradient(900px 560px at 88% 92%, rgba(67, 56, 202, .45), transparent 60%),
    linear-gradient(150deg, #0b1220 0%, #0e1526 55%, #070b13 100%);
  color: #e2e8f0;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
}

.auth-visual > * { position: relative; z-index: 1; }

.av-brand { display: flex; align-items: center; gap: .85rem; }
.av-brand-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.av-brand-icon img { width: 34px; height: 34px; object-fit: contain; }
.av-brand img.av-word { width: 196px; height: auto; max-height: 30px; object-fit: contain; }
.av-brand-sub {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-top: .3rem;
}

.av-headline {
  font-size: 2.55rem;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.08;
  margin-bottom: 1rem;
  color: #f8fafc;
}
.av-headline em {
  font-style: normal;
  background: linear-gradient(100deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.av-lede {
  font-size: .92rem;
  color: #94a3b8;
  max-width: 46ch;
  line-height: 1.65;
}

.av-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
  margin-top: 2rem;
  max-width: 480px;
}
.av-metric {
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: .9rem 1rem;
  backdrop-filter: blur(8px);
}
.av-metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #f8fafc;
}
.av-metric-label {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #64748b;
  margin-top: .2rem;
}

.av-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem 1.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, .09);
  max-width: 560px;
}
.av-feature { display: flex; align-items: flex-start; gap: .55rem; font-size: .8rem; color: #cbd5e1; }
.av-feature svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: #34d399; stroke-width: 2.2; }

.av-foot { font-size: .68rem; color: #475569; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Form panel ---------- */
.auth-panel {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
}
body.dark-auth .auth-panel { background: #070b13; }

.auth-card { width: 100%; max-width: 400px; }
.auth-brand-m { display: none; }

.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #0b1220;
  margin-bottom: .3rem;
}
body.dark-auth .auth-title { color: #f1f5f9; }
.auth-sub { font-size: .84rem; color: #64748b; margin-bottom: 1.6rem; }

.auth-field { margin-bottom: .95rem; }
.auth-label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .4rem;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap svg {
  position: absolute;
  left: .85rem;
  width: 16px; height: 16px;
  fill: none; stroke: #94a3b8; stroke-width: 1.9;
  pointer-events: none;
}
.auth-input-wrap .eye {
  position: absolute;
  right: .7rem;
  background: none; border: none;
  cursor: pointer;
  padding: .2rem;
  display: grid; place-items: center;
  color: #94a3b8;
}
.auth-input-wrap .eye:hover { color: #0369a1; }
.auth-input-wrap .eye svg { position: static; width: 16px; height: 16px; }

.auth-input {
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: .78rem .85rem .78rem 2.5rem;
  font-family: inherit;
  font-size: .87rem;
  font-weight: 500;
  color: #0b1220;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
body.dark-auth .auth-input { background: #0e1526; border-color: rgba(255,255,255,.1); color: #f1f5f9; }
.auth-input::placeholder { color: #94a3b8; }
.auth-input:focus {
  border-color: #0369a1;
  box-shadow: 0 0 0 3.5px rgba(3, 105, 161, .13);
}
.auth-input.invalid {
  border-color: #be123c;
  box-shadow: 0 0 0 3.5px rgba(190, 18, 60, .12);
}
.auth-input.shake { animation: shake .34s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.2rem;
  flex-wrap: wrap;
}
.auth-check { display: flex; align-items: center; gap: .45rem; font-size: .76rem; color: #475569; cursor: pointer; user-select: none; }
.auth-check input { accent-color: #0369a1; width: 14px; height: 14px; cursor: pointer; }
.auth-link {
  background: none; border: none;
  color: #0369a1;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.auth-link:hover { text-decoration: underline; }

.auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #0369a1, #4338ca);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .01em;
  padding: .88rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  box-shadow: 0 8px 22px -8px rgba(3, 105, 161, .6);
  transition: transform .16s, box-shadow .16s, opacity .16s;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(3, 105, 161, .7); }
.auth-submit:active:not(:disabled) { transform: scale(.985); }
.auth-submit:disabled { opacity: .62; cursor: not-allowed; }
.auth-submit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.25rem 0;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #94a3b8;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
body.dark-auth .auth-divider::before, body.dark-auth .auth-divider::after { background: rgba(255,255,255,.1); }

.demo-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: .9rem 1rem;
}
body.dark-auth .demo-panel { background: #0e1526; border-color: rgba(255,255,255,.1); }
.demo-panel-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #047857;
  margin-bottom: .55rem;
}
.demo-panel-head svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.demo-cred { display: flex; gap: .6rem; font-size: .8rem; }
.demo-cred-row { flex: 1; }
.demo-cred-label { font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.demo-cred-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #0b1220; }
body.dark-auth .demo-cred-value { color: #f1f5f9; }
.demo-fill {
  width: 100%;
  margin-top: .7rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  border-radius: 9px;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 800;
  padding: .5rem;
  cursor: pointer;
  transition: background .16s;
}
.demo-fill:hover { background: #d1fae5; }

.auth-error {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 600;
  padding: .62rem .8rem;
  margin-bottom: .9rem;
}
.auth-error svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }

.auth-foot { margin-top: 1.6rem; text-align: center; font-size: .68rem; color: #94a3b8; line-height: 1.6; }
.auth-foot .chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  border-radius: 6px;
  padding: .18rem .45rem;
  margin-bottom: .6rem;
}

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.theme-fab {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  color: #475569;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  transition: transform .16s, color .16s;
}
.theme-fab:hover { transform: translateY(-1px); color: #0369a1; }
.theme-fab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
body.dark-auth .theme-fab { background: #0e1526; border-color: rgba(255,255,255,.1); color: #cbd5e1; }

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 2rem 1.25rem; }
  .auth-brand-m { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem; }
  .auth-brand-m img { width: 150px; height: auto; max-height: 24px; object-fit: contain; }
  body.dark-auth .auth-brand-m img { filter: brightness(1.7) saturate(.6); }
}
