/* ================================================================
   DR.MACHINES — login.css  (auth pages — card + canvas bg)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0B1628;
  --navy-mid:  #0D1E36;
  --navy-deep: #060E1C;
  --cyan:      #00D4FF;
  --cyan-dim:  rgba(0,212,255,0.10);
  --amber:     #FFB340;
  --amber-dim: rgba(255,179,64,0.10);
  --green:     #4ADE80;
  --steel:     #8CA0B8;
  --steel-dim: #4A6080;
  --white:     #F0F4F8;
  --border:    rgba(140,160,184,0.13);
  --red:       #F87171;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--navy-deep);
  color: var(--white);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── SKIP LINK ── */
.skip-link {
  position: absolute; left: -9999px; top: 4px;
  background: var(--cyan); color: var(--navy);
  padding: 4px 12px; font-weight: 700; z-index: 9999; border-radius: 4px;
}
.skip-link:focus { left: 16px; }

/* ── CANVAS BACKGROUND ── */
#auth-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ══════════════════════════════════════════
   CENTERED AUTH PAGE
══════════════════════════════════════════ */
.auth-page {
  position: relative; z-index: 1;
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow: hidden;
}

/* ── AUTH BOX (card) ── */
.auth-box {
  position: relative;
  background: rgba(11,22,40,0.90);
  border: 1px solid rgba(0,212,255,0.13);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px 24px 18px;
  width: 100%; max-width: 430px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.18) transparent;
}
.auth-box::-webkit-scrollbar { width: 4px; }
.auth-box::-webkit-scrollbar-track { background: transparent; }
.auth-box::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.18); border-radius: 2px; }
.auth-box-wide { max-width: 530px; }

/* ── CLOSE BUTTON ── */
.auth-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  background: none; border: none;
  color: var(--steel-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
  font-size: 14px; line-height: 1;
}
.auth-close:hover { color: var(--white); background: rgba(255,255,255,0.07); }

/* ── LOGO WRAP ── */
.auth-logo-wrap {
  display: flex; justify-content: center;
  margin-bottom: 14px;
  font-weight: 700; font-size: 22px; letter-spacing: -0.5px;
}
.auth-logo-wrap a { color: var(--white); text-decoration: none; }
.auth-logo-wrap span { color: var(--cyan); }

/* ── VERIFY BANNER ── */
.auth-verify {
  display: none; padding: 8px 12px; border-radius: 6px;
  margin-bottom: 14px; font-size: 12px; line-height: 1.5;
}
.auth-verify.is-success {
  background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25);
  color: var(--green); display: block;
}
.auth-verify.is-error {
  background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.25);
  color: var(--red); display: block;
}

/* ── HEADING ── */
.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 4px; color: var(--white);
}
.auth-sub {
  font-size: 12.5px; color: var(--steel);
  margin-bottom: 14px; line-height: 1.5;
}

/* ── SIGNUP TABS ── */
.su-tabs {
  display: flex; gap: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 3px;
  margin-bottom: 14px;
}
.su-tab {
  flex: 1; padding: 7px 10px;
  border-radius: 7px; border: none;
  font-size: 13px; font-weight: 600;
  background: none; color: var(--steel);
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.su-tab.active {
  background: var(--navy-mid);
  color: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.su-tab:hover:not(.active) { color: var(--white); }

/* ── EXPERT NOTICE BANNER ── */
.expert-notice {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px; padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12.5px; color: var(--steel); line-height: 1.55;
  display: flex; align-items: flex-start; gap: 9px;
}
.expert-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--cyan); }

/* ── FORM GROUPS ── */
.form-group { margin-bottom: 10px; }

.form-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 700; color: var(--steel);
  margin-bottom: 6px; letter-spacing: 0.4px; text-transform: uppercase;
}
.form-label a {
  color: var(--cyan); font-size: 11px; font-weight: 500;
  text-transform: none; letter-spacing: 0;
}
.form-label a:hover { text-decoration: underline; }

.form-input {
  width: 100%; background: var(--navy-deep);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 8px; padding: 8px 11px;
  color: var(--white); font-size: 13px;
  font-family: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; -webkit-appearance: none;
}
.form-input:focus {
  border-color: rgba(0,212,255,0.48);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.07);
}
.form-input::placeholder { color: var(--steel-dim); }
.form-input:disabled { opacity: 0.45; }

.lc-input {}

.form-group.is-error .form-input       { border-color: rgba(248,113,113,0.55); }
.form-group.is-error .form-input:focus { border-color: rgba(248,113,113,0.8); }
.form-group.is-valid .form-input       { border-color: rgba(74,222,128,0.3); }

.form-error {
  display: block; font-size: 11px; color: var(--red);
  margin-top: 3px; min-height: 14px; line-height: 1.4;
}

/* ── PASSWORD WRAP ── */
.form-pw-wrap { position: relative; }
.form-pw-wrap .form-input { padding-right: 40px; }

.lc-eye {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 38px; background: none; border: none;
  color: var(--steel-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1; transition: color 0.15s;
}
.lc-eye:hover { color: var(--cyan); }
.lc-eye svg { width: 15px; height: 15px; flex-shrink: 0; }
.lc-eye .lc-eye-hide { display: none; }

/* ── SELECT ── */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='6' viewBox='0 0 11 6'%3E%3Cpath d='M1 1l4.5 4L10 1' stroke='%238CA0B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; cursor: pointer;
}
select.form-input option { background: var(--navy-mid); }

/* ── TEXTAREA ── */
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── FORM ROWS ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ── ADDRESS 4-COLUMN ROW ── */
.form-row-4 {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 9px; margin-top: 7px;
}

/* ── PHONE ROW ── */
.phone-row { display: flex; }
.phone-row select.form-input {
  width: 96px; flex-shrink: 0;
  border-radius: 8px 0 0 8px; border-right: none;
  padding-right: 22px; font-size: 12px;
}
.phone-row input.form-input { flex: 1; border-radius: 0 8px 8px 0; }

/* ── MULTI-SELECT (products you can support) ── */
.ms-select { position: relative; }
.ms-control {
  display: flex; align-items: center; gap: 8px; min-height: 36px;
  background: var(--navy-deep); border: 1px solid rgba(0,212,255,0.15);
  border-radius: 8px; padding: 6px 11px; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ms-control:focus-visible { outline: none; border-color: rgba(0,212,255,0.48); box-shadow: 0 0 0 3px rgba(0,212,255,0.07); }
.ms-select.open .ms-control { border-color: rgba(0,212,255,0.48); box-shadow: 0 0 0 3px rgba(0,212,255,0.07); }
.ms-select.disabled .ms-control { opacity: 0.45; cursor: default; pointer-events: none; }
.ms-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.ms-placeholder { color: var(--steel-dim); font-size: 13px; padding: 2px 0; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--cyan-dim); border: 1px solid rgba(0,212,255,0.3);
  color: var(--cyan); border-radius: 6px; padding: 3px 7px;
  font-size: 11.5px; font-weight: 600;
}
.ms-chip button { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 11px; padding: 0; line-height: 1; }
.ms-chip button:hover { color: var(--white); }
.ms-caret { color: var(--steel-dim); flex-shrink: 0; transition: transform 0.2s; }
.ms-select.open .ms-caret { transform: rotate(180deg); }
.ms-menu {
  display: none; position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 50;
  background: var(--navy-mid); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5); overflow: hidden;
}
.ms-select.open .ms-menu { display: block; }
.ms-search { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ms-search svg { color: var(--steel-dim); flex-shrink: 0; }
.ms-search input { flex: 1; background: none; border: none; color: var(--white); font-size: 12.5px; outline: none; font-family: inherit; }
.ms-options { max-height: 190px; overflow-y: auto; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--white); cursor: pointer; }
.ms-opt:hover { background: rgba(0,212,255,0.06); }
.ms-opt.sel { background: rgba(0,212,255,0.08); }
.ms-opt-meta { margin-left: auto; color: var(--steel-dim); font-size: 11px; }
.ms-check { width: 12px; flex-shrink: 0; color: var(--cyan); font-size: 10px; line-height: 1; }
.ms-opt-empty { padding: 12px 10px; font-size: 12.5px; color: var(--steel-dim); }

/* ── CHECKBOX ── */
.form-check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--steel); margin-bottom: 8px;
}
.form-check input[type="checkbox"],
.lc-check-input {
  margin-top: 2px; flex-shrink: 0;
  accent-color: var(--cyan); width: 14px; height: 14px; cursor: pointer;
}
.form-check label { cursor: pointer; line-height: 1.5; }
.form-check a, .su-link { color: var(--cyan); font-weight: 600; }
.form-check a:hover, .su-link:hover { text-decoration: underline; }
.form-group.is-error .form-check,
.form-group.is-error .form-check label { color: var(--red); }

/* ── EXPERT TOGGLE (hidden by tabs — kept for signup.js) ── */
.expert-toggle { display: none; }

/* ── EXPERT FIELDS (signup.js toggles .is-open) ── */
#expert-fields { display: none; }
#expert-fields.is-open {
  display: block;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,212,255,0.10);
}

/* ── SUBMIT BUTTON ── */
.form-btn, .lc-btn-login {
  position: relative; width: 100%;
  padding: 10px 20px; margin-top: 4px;
  background: var(--cyan); color: var(--navy-deep);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
  border: none; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
}
.form-btn:hover, .lc-btn-login:hover {
  opacity: 0.92; transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,255,0.28);
}
.form-btn:active, .lc-btn-login:active { transform: scale(0.99); opacity: 1; }
.form-btn:disabled, .lc-btn-login:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none;
}

a.lc-btn-login {
  display: inline-flex; width: auto; min-width: 160px; margin-top: 4px;
}

.lc-btn-text { position: relative; z-index: 1; }
.lc-btn-spinner {
  position: absolute; z-index: 2; width: 18px; height: 18px;
  border: 2px solid rgba(0,13,26,0.2); border-top-color: var(--navy-deep);
  border-radius: 50%; opacity: 0; animation: lcSpin 0.65s linear infinite;
}
@keyframes lcSpin { to { transform: rotate(360deg); } }
.form-btn.is-loading .lc-btn-text    { opacity: 0; }
.form-btn.is-loading .lc-btn-spinner { opacity: 1; }

/* ── OR DIVIDER ── */
.auth-divider {
  display: flex; align-items: center; gap: 10px; margin: 12px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; border-top: 1px solid rgba(255,255,255,0.07);
}
.auth-divider span { font-size: 11px; color: var(--steel-dim); white-space: nowrap; }

/* ── SOCIAL BUTTONS (2×2 grid) ── */
.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.social-btn {
  padding: 8px 6px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid rgba(240,244,248,0.10); background: var(--navy-deep);
  color: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-family: inherit; white-space: nowrap;
  text-decoration: none;
}
.social-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(240,244,248,0.22);
  transform: translateY(-2px);
}
.social-btn svg { flex-shrink: 0; }

/* ── FOOTER LINK ── */
.auth-footer-link {
  text-align: center; font-size: 12.5px; color: var(--steel); margin-top: 10px;
}
.auth-footer-link a { color: var(--cyan); font-weight: 600; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ── SUCCESS STATE ── */
.su-success {
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 12px; padding: 8px 6px 4px;
}
.su-success-icon { width: 52px; height: 52px; color: var(--cyan); }
.su-success-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 700; color: var(--white);
}
.su-success-body { font-size: 13px; color: var(--steel); line-height: 1.6; max-width: 320px; }

/* ── RESPONSIVE ── */
@media (max-width: 560px) {
  .auth-page { padding: 10px; }
  .auth-box, .auth-box-wide { padding: 18px 16px 14px; max-height: calc(100vh - 20px); }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .social-btns { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .lc-btn-spinner { animation: none; }
}
