/* ============================================================================
   entry-auth.css — refined clinical login experience
   Loaded AFTER styles.css so it overrides the base .entry-* rules.
   Scope: splash, client-login, and admin-login screens only.
   Brand tokens (teal / aqua / Titillium Web) are inherited from styles.css.
   ============================================================================ */

:root {
  --auth-field-border: rgba(2, 77, 94, 0.18);
  --auth-field-border-strong: rgba(2, 77, 94, 0.30);
  --auth-focus-ring: rgba(2, 77, 94, 0.16);
  --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Shared field architecture ───────────────────────────────────────── */

.entry-field {
  display: grid;
  gap: 7px;
}

.entry-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.entry-field-label .req {
  color: var(--danger);
  margin-left: 2px;
}

.entry-field-control {
  position: relative;
  display: flex;
  align-items: center;
}

/* Leading icon */
.entry-field-icon {
  position: absolute;
  left: 16px;
  width: 19px;
  height: 19px;
  color: var(--ink-soft);
  pointer-events: none;
  transition: color 200ms var(--auth-ease);
}

/* Re-style inputs inside the new control wrapper (overrides .entry-form input) */
.entry-field-control input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px 14px 46px;
  border-radius: 14px;
  border: 1px solid var(--auth-field-border);
  background: #fff;
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 2px rgba(2, 30, 40, 0.04);
  transition:
    border-color 200ms var(--auth-ease),
    box-shadow 200ms var(--auth-ease),
    background-color 200ms var(--auth-ease);
}

/* Password field leaves room for the toggle on the right */
.entry-field-control.has-toggle input {
  padding-right: 50px;
}

.entry-field-control input::placeholder {
  color: rgba(75, 108, 118, 0.55);
  letter-spacing: 0;
}

.entry-field-control input:hover {
  border-color: var(--auth-field-border-strong);
}

.entry-field-control input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow:
    0 0 0 4px var(--auth-focus-ring),
    inset 0 1px 2px rgba(2, 30, 40, 0.04);
}

.entry-field-control input:focus ~ .entry-field-icon,
.entry-field-control:focus-within .entry-field-icon {
  color: var(--primary);
}

/* Autofill harmonisation */
.entry-field-control input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px transparent;
  caret-color: var(--ink);
}

/* Password show / hide toggle */
.entry-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  transition: color 180ms var(--auth-ease), background-color 180ms var(--auth-ease);
}

.entry-pass-toggle:hover,
.entry-pass-toggle:focus-visible {
  color: var(--primary);
  background: rgba(2, 77, 94, 0.07);
  box-shadow: none;
  transform: translateY(-50%);
}

.entry-pass-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.entry-pass-toggle svg {
  width: 19px;
  height: 19px;
}

.entry-pass-toggle .icon-hide {
  display: none;
}

.entry-pass-toggle[aria-pressed="true"] .icon-show {
  display: none;
}

.entry-pass-toggle[aria-pressed="true"] .icon-hide {
  display: block;
}

/* ── Buttons: refined focus + crisper primary ────────────────────────── */

.entry-action.button-primary {
  min-height: 54px;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(2, 77, 94, 0.20);
}

.entry-action.button-primary:hover {
  box-shadow: 0 16px 30px rgba(2, 77, 94, 0.26);
}

.entry-action.button-secondary {
  min-height: 54px;
  border: 1px solid rgba(2, 77, 94, 0.16);
}

.button-primary:focus-visible,
.button-secondary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Client split login: brand panel trust signals ───────────────────── */

.entry-split-brand {
  align-content: space-between;
  justify-items: stretch;
  text-align: left;
  gap: 0;
  padding: 48px 42px;
}

/* Subtle dotted clinical texture over the gradient */
.entry-split-brand {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0),
    linear-gradient(160deg, var(--brand-dark-strong) 0%, var(--brand-dark) 65%, #025f73 100%);
  background-size: 22px 22px, 100% 100%;
}

.entry-split-brand-top {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  justify-items: start;
}

.entry-split-brand .entry-split-logo {
  max-width: 168px;
  margin: 0;
}

.entry-split-brand-copy h2 {
  font-size: 1.5rem;
  line-height: 1.18;
}

.entry-split-brand-copy p {
  font-size: 0.9rem;
}

/* Trust list */
.entry-trust-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 13px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.entry-trust-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.86);
}

.entry-trust-list .trust-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(119, 194, 206, 0.18);
  border: 1px solid rgba(119, 194, 206, 0.28);
  color: var(--brand-aqua);
}

.entry-trust-list .trust-ico svg {
  width: 16px;
  height: 16px;
}

.entry-split-brand-sub {
  position: relative;
  z-index: 1;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ── Form column polish ──────────────────────────────────────────────── */

.entry-split-form {
  gap: 20px;
  padding: 46px 46px;
}

.entry-split-form-head h3 {
  font-size: 1.6rem;
}

.entry-split-form-head p {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 38ch;
}

/* Visual separator before the secondary link clusters */
.entry-split-form .entry-link-cluster:first-of-type {
  margin-top: 2px;
  padding-top: 18px;
  border-top: 1px solid rgba(2, 77, 94, 0.10);
}

.entry-support-card {
  border-radius: 14px;
  border-color: rgba(2, 77, 94, 0.14);
  text-align: left;
  min-height: 0;
  padding: 13px 16px 13px 46px;
  position: relative;
}

.entry-support-card::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  background: currentColor;
  color: var(--success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── Status messages: refined with leading rule ──────────────────────── */

.entry-status-message:not(.hidden) {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.entry-status-message.error:not(.hidden) {
  color: var(--danger);
  background: rgba(182, 72, 61, 0.08);
  border-color: rgba(182, 72, 61, 0.22);
}

.entry-status-message.success:not(.hidden) {
  color: var(--success);
  background: rgba(47, 143, 91, 0.08);
  border-color: rgba(47, 143, 91, 0.22);
}

/* ── Admin login: secure-area treatment ──────────────────────────────── */

.entry-card-admin-v2 {
  width: min(100%, 440px);
}

.entry-admin-header {
  padding: 22px 30px;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0),
    linear-gradient(135deg, var(--brand-dark-strong), var(--brand-dark));
  background-size: 20px 20px, 100% 100%;
}

.entry-admin-body {
  padding: 30px;
  gap: 18px;
}

.entry-admin-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: start;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: rgba(2, 77, 94, 0.07);
  border: 1px solid rgba(2, 77, 94, 0.14);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-admin-secure-badge svg {
  width: 13px;
  height: 13px;
}

.entry-admin-title h2 {
  font-size: 1.3rem;
}

.entry-admin-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.entry-admin-footnote svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--success);
}

/* ── Splash refinements ──────────────────────────────────────────────── */

.entry-splash-copy h1 {
  font-size: 1.8rem;
}

.entry-splash-actions .button-primary {
  min-height: 54px;
}

/* ── Entrance motion (staggered, accessible) ─────────────────────────── */

@keyframes entryFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-view-active .entry-card-login-split,
.entry-view-active .entry-card-admin-v2,
.entry-view-active .entry-card-splash-v2 {
  animation: entryFadeUp 520ms var(--auth-ease) both;
}

.entry-view-active .entry-split-form > *,
.entry-view-active .entry-admin-body > * {
  animation: entryFadeUp 460ms var(--auth-ease) both;
}

.entry-view-active .entry-split-form > *:nth-child(1) { animation-delay: 90ms; }
.entry-view-active .entry-split-form > *:nth-child(2) { animation-delay: 150ms; }
.entry-view-active .entry-split-form > *:nth-child(3) { animation-delay: 210ms; }
.entry-view-active .entry-split-form > *:nth-child(4) { animation-delay: 270ms; }
.entry-view-active .entry-split-form > *:nth-child(5) { animation-delay: 330ms; }
.entry-view-active .entry-split-form > *:nth-child(6) { animation-delay: 390ms; }

.entry-view-active .entry-admin-body > *:nth-child(1) { animation-delay: 90ms; }
.entry-view-active .entry-admin-body > *:nth-child(2) { animation-delay: 160ms; }
.entry-view-active .entry-admin-body > *:nth-child(3) { animation-delay: 230ms; }

@media (prefers-reduced-motion: reduce) {
  .entry-view-active .entry-card-login-split,
  .entry-view-active .entry-card-admin-v2,
  .entry-view-active .entry-card-splash-v2,
  .entry-view-active .entry-split-form > *,
  .entry-view-active .entry-admin-body > * {
    animation: none;
  }
}

/* ── Mobile adjustments ──────────────────────────────────────────────── */

@media (max-width: 660px) {
  .entry-split-brand {
    padding: 32px 28px;
  }

  .entry-trust-list {
    margin-top: 22px;
    gap: 10px;
  }

  .entry-split-brand-sub {
    margin-top: 22px;
  }

  .entry-split-form {
    padding: 32px 26px;
  }

  .entry-split-form-head h3 {
    font-size: 1.4rem;
  }
}
