/* ================================================================
   MEDTRONEX — Authentication Pages
   Split-screen layout, premium Amazon-inspired but original design
   ================================================================ */

:root {
  --auth-primary: #0f766e;
  --auth-accent: #f59e0b;
  --auth-form-bg: #ffffff;
  --auth-radius: 14px;
  --auth-input-radius: 10px;
  --auth-btn-radius: 10px;
  --auth-font: Inter, system-ui, sans-serif;
  --auth-heading-size: 28px;
  --auth-body-size: 15px;
  --auth-form-max: 440px;
}

/* ── Split Screen Shell ── */
.auth-split {
  display: flex;
  min-height: 100vh;
  font-family: var(--auth-font);
}

/* ── Brand Panel (Left) ── */
.auth-brand {
  flex: 0 0 48%;
  background: linear-gradient(145deg, #0f2027, var(--auth-primary) 52%, #115e59);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(245,158,11,.08);
}

.auth-brand .ab-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.auth-brand .ab-logo .mark {
  width: 48px;
  height: 48px;
  background: var(--auth-accent);
  color: #0f2027;
  font-weight: 900;
  font-size: 24px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.auth-brand .ab-logo .name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-brand .ab-logo .name small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  opacity: .7;
}

.auth-brand h2 {
  font-size: var(--auth-heading-size);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.auth-brand p {
  font-size: 16px;
  line-height: 1.7;
  opacity: .82;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-brand .ab-features {
  margin-top: 40px;
  list-style: none;
  position: relative;
  z-index: 1;
}

.auth-brand .ab-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14.5px;
  line-height: 1.5;
  opacity: .85;
}

.auth-brand .ab-features li .ab-fi {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,.12);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-top: 1px;
}

/* ── Form Panel (Right) ── */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  background: #f8fafc;
}

.auth-form-shell {
  width: 100%;
  max-width: var(--auth-form-max);
}

.auth-form-shell .af-header {
  margin-bottom: 28px;
}

.auth-form-shell .af-header h1 {
  font-size: var(--auth-heading-size);
  font-weight: 800;
  color: #0f2027;
  margin-bottom: 6px;
}

.auth-form-shell .af-header p {
  font-size: 14.5px;
  color: #64748b;
  line-height: 1.5;
}

/* ── Form Card ── */
.auth-form-card {
  background: var(--auth-form-bg);
  border-radius: var(--auth-radius);
  padding: 32px;
  border: 1px solid #e8ecf1;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

/* ── Alerts ── */
.auth-alert {
  padding: 12px 16px;
  border-radius: var(--auth-input-radius);
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  animation: authFadeIn .3s ease;
}

.auth-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.auth-alert .aa-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 15px;
}

/* ── Form Fields ── */
.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.auth-field label .req {
  color: #dc2626;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="tel"],
.auth-field input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--auth-input-radius);
  font-size: var(--auth-body-size);
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}

.auth-field input::placeholder {
  color: #94a3b8;
}

.auth-field .af-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Password Strength Meter ── */
.auth-pwd-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.auth-pwd-meter span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background .3s;
}

.auth-pwd-meter.weak span:nth-child(1) { background: #dc2626; }
.auth-pwd-meter.fair span:nth-child(-n+2) { background: var(--auth-accent); }
.auth-pwd-meter.good span:nth-child(-n+3) { background: #22c55e; }
.auth-pwd-meter.strong span { background: #16a34a; }

/* ── Password Requirements ── */
.auth-pwd-reqs {
  list-style: none;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.auth-pwd-reqs li {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .2s;
}

.auth-pwd-reqs li.met {
  color: #16a34a;
}

.auth-pwd-reqs li .apr {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  display: grid;
  place-items: center;
  font-size: 8px;
  flex-shrink: 0;
  transition: all .2s;
}

.auth-pwd-reqs li.met .apr {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* ── Buttons ── */
.auth-btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--auth-btn-radius);
  font-size: var(--auth-body-size);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .05s, filter .15s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn:hover {
  filter: brightness(.94);
}

.auth-btn-primary {
  background: linear-gradient(180deg, #0d9488, var(--auth-primary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.25);
}

.auth-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(15,118,110,.3);
}

.auth-btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  filter: none;
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ── Links ── */
.auth-links {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
  line-height: 2;
}

.auth-links a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--auth-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.auth-link-btn:hover {
  text-decoration: underline;
}

/* ── Step Indicator ── */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.auth-step-dot {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background .3s;
}

.auth-step-dot.done {
  background: #16a34a;
}

.auth-step-dot.active {
  background: var(--auth-primary);
  width: 48px;
}

/* ── 2FA Code Input ── */
.auth-code-input {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.auth-code-input input {
  width: 52px;
  height: 58px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: "SF Mono", "Cascadia Code", monospace;
}

.auth-code-input input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

/* ── Success State ── */
.auth-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
}

/* ── Animations ── */
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-shake {
  animation: authShake .4s ease;
}

.auth-fade-in {
  animation: authFadeIn .4s ease;
}

/* ── Show/Hide Password Toggle ── */
.auth-pwd-wrap {
  position: relative;
}

.auth-pwd-wrap input {
  padding-right: 44px;
}

.auth-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
  padding: 4px;
  line-height: 1;
}

.auth-pwd-toggle:hover {
  color: #475569;
}

/* ── Admin Login Variant ── */
.auth-admin-brand {
  background: linear-gradient(145deg, #101b2d, #1a2a44 52%, var(--auth-primary));
}

.auth-admin-brand::after {
  background: rgba(15,118,110,.15);
}

/* ── Footer inside form panel ── */
.auth-form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.auth-form-footer a {
  color: #64748b;
}

/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-panel {
    padding: 24px 16px;
    min-height: 100vh;
  }

  .auth-form-shell {
    max-width: 100%;
  }

  .auth-form-card {
    padding: 24px 18px;
    border-radius: 12px;
  }

  .auth-pwd-reqs {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .auth-brand {
    flex: 0 0 42%;
    padding: 48px 36px;
  }

  .auth-brand h2 {
    font-size: calc(var(--auth-heading-size) - 2px);
  }

  .auth-brand p {
    font-size: 14.5px;
  }
}

/* ── Password change (inside account layout) ── */
.auth-card-inline {
  background: var(--auth-form-bg);
  border-radius: var(--auth-radius);
  padding: 32px;
  border: 1px solid #e8ecf1;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  max-width: 520px;
}

.auth-card-inline h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f2027;
  margin-bottom: 6px;
}

.auth-card-inline p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 22px;
}

/* ================================================================
   AMAZON THEME — single column, centered card + yellow CTAs
   Enabled via body.auth-theme-amazon (settings -> theme -> auth_theme)
   ================================================================ */

body.auth-theme-amazon {
  --auth-font: "Amazon Ember", "Segoe UI", Arial, Helvetica, sans-serif;
  --auth-primary: #0066c0;
  --auth-btn-gradient: linear-gradient(to bottom, #f7dfa5, #f0c14b);
  --auth-btn-border: #a88734;
  --auth-card-max: 350px;
}

body.auth-theme-amazon .auth-split {
  display: block;
  min-height: 100vh;
  background: #fff;
}

body.auth-theme-amazon .auth-brand {
  display: none;
}

body.auth-theme-amazon .auth-form-panel {
  background: #fff;
  padding: 26px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.auth-theme-amazon .auth-form-shell {
  max-width: var(--auth-card-max);
}

.amz-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  margin: 4px auto 22px;
  user-select: none;
}

.amz-logo .amz-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #111;
  line-height: 1;
  text-transform: uppercase;
}

.amz-logo .amz-name small {
  display: block;
  font-size: 10px;
  letter-spacing: 5px;
  color: #565959;
  font-weight: 600;
  margin-top: 5px;
  text-transform: uppercase;
}

body.auth-theme-amazon .af-header {
  margin-bottom: 10px;
}

body.auth-theme-amazon .af-header h1 {
  font-size: 28px;
  font-weight: 400;
  color: #111;
  margin-bottom: 2px;
}

body.auth-theme-amazon .af-header p {
  font-size: 13px;
  color: #565959;
  line-height: 1.45;
}

body.auth-theme-amazon .auth-form-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px 26px 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.14);
}

body.auth-theme-amazon .auth-field label {
  color: #111;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}

body.auth-theme-amazon .auth-field input[type="text"],
body.auth-theme-amazon .auth-field input[type="email"],
body.auth-theme-amazon .auth-field input[type="password"],
body.auth-theme-amazon .auth-field input[type="tel"],
body.auth-theme-amazon .auth-field input[type="number"] {
  height: 31px;
  border: 1px solid #a6a6a6;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 14px;
  box-shadow: none;
  color: #0f1111;
}

body.auth-theme-amazon .auth-field input:focus {
  border-color: #e77600;
  box-shadow: 0 0 3px 2px rgba(228,121,17,.5);
}

body.auth-theme-amazon .auth-field input::placeholder {
  color: #8a8f99;
}

body.auth-theme-amazon .auth-btn {
  height: 31px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

body.auth-theme-amazon .auth-btn-primary {
  background: var(--auth-btn-gradient);
  border: 1px solid var(--auth-btn-border);
  color: #111;
  box-shadow: none;
}

body.auth-theme-amazon .auth-btn-primary:hover {
  filter: brightness(.93);
  box-shadow: none;
}

body.auth-theme-amazon .auth-links {
  margin-top: 18px;
  font-size: 13px;
  color: #565959;
  line-height: 1.8;
}

body.auth-theme-amazon .auth-links a {
  color: var(--auth-primary);
  font-weight: 400;
}

body.auth-theme-amazon .auth-link-btn {
  color: var(--auth-primary);
  font-weight: 400;
}

body.auth-theme-amazon .auth-divider {
  margin: 24px 0 14px;
  color: #767676;
}

body.auth-theme-amazon .auth-divider::before,
body.auth-theme-amazon .auth-divider::after {
  background: #e7e7e7;
}

.amz-create-btn {
  height: 31px;
  border: 1px solid #adb1b8;
  border-radius: 4px;
  background: linear-gradient(to bottom, #fff, #e9edf4);
  color: #111;
  font-weight: 400;
  text-decoration: none;
}

.amz-create-btn:hover {
  background: linear-gradient(to bottom, #f7f8fa, #e7eaf0);
  color: #111;
}

.amz-help {
  font-size: 12px;
  color: #565959;
}

.amz-help a {
  color: var(--auth-primary);
}

body.auth-theme-amazon .auth-form-card p {
  font-size: 12.5px;
  color: #565959;
  line-height: 1.5;
}

body.auth-theme-amazon .auth-form-footer {
  border-top: 1px solid #e7e7e7;
  margin: 28px 0 0;
  padding: 18px 16px 40px;
  font-size: 12px;
  color: #565959;
}

body.auth-theme-amazon .auth-form-footer .amz-footer-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

body.auth-theme-amazon .auth-form-footer a {
  color: var(--auth-primary);
  font-weight: 400;
  text-decoration: none;
}

body.auth-theme-amazon .auth-form-footer a:hover {
  text-decoration: underline;
}

body.auth-theme-amazon .auth-pwd-toggle {
  color: #565959;
}

body.auth-theme-amazon .auth-pwd-reqs li {
  font-size: 11.5px;
}

@media (max-width: 420px) {
  body.auth-theme-amazon .auth-form-shell {
    max-width: 100%;
  }

  body.auth-theme-amazon .auth-form-footer {
    margin-left: -16px;
    margin-right: -16px;
  }
}
