/* ==========================================================================
   AutoVeer Employee Portal — Login
   ========================================================================== */

:root {
  --navy-900: #071c45;
  --navy-800: #0a2a62;
  --navy-700: #123a7a;
  --navy-500: #2a5aa8;
  --ink: #0f1f3d;
  --muted: #6b7a90;
  --line: #d7dee8;
  --field-bg: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.88);
  --page-bg: #e9f0f8;
  --danger: #c0352b;
  --success: #1f7a4d;
  --radius-lg: 32px;
  --radius-md: 10px;
  --shadow-card: 0 30px 60px -20px rgba(10, 42, 98, 0.25), 0 8px 24px rgba(10, 42, 98, 0.08);
  --focus: 0 0 0 4px rgba(42, 90, 168, 0.18);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #dce8f5 0%, var(--page-bg) 55%, #f4f7fb 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Background scene ---------- */
.scene {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #dbe8f6 url("../assets/login-bg.webp") left bottom / cover no-repeat;
}

/* ---------- Layout ---------- */
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}

@media (min-width: 1024px) {
  .login-wrap { justify-content: flex-end; padding-right: max(6vw, 32px); }
}
@media (min-width: 1400px) {
  .login-wrap { justify-content: center; padding-left: 30vw; padding-right: 0; }
}

/* ---------- Top-right links: Login / Careers ---------- */
.topnav {
  position: fixed; top: 18px; right: 22px; z-index: 5;
  display: flex; gap: 6px; padding: 5px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 999px;
  box-shadow: 0 10px 26px -14px rgba(7, 28, 69, .45);
}
.topnav__link {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  font-size: .92rem; font-weight: 600; color: var(--navy-800); text-decoration: none;
  border-radius: 999px; transition: background .2s, color .2s;
}
.topnav__link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topnav__link .topnav__ext { width: 13px; height: 13px; opacity: .7; margin-left: -2px; }
.topnav__link:hover { background: rgba(42, 90, 168, .1); }
.topnav__link:focus-visible { outline: none; box-shadow: var(--focus); }
.topnav__link.is-active { color: #fff; background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); }
@media (max-width: 520px) {
  .topnav { top: 10px; right: 10px; }
  .topnav__link { height: 34px; padding: 0 12px; font-size: .85rem; }
}

/* ---------- Card ---------- */
.login-card {
  width: 100%; max-width: 520px;
  padding: 40px 48px 48px;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  animation: card-in .5s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.login-card__brand { text-align: center; margin-bottom: 32px; }

.brand-logo { width: min(300px, 80%); height: auto; display: block; margin: 0 auto 14px; }

.portal-title {
  display: flex; align-items: center; gap: 18px;
  margin: 0; font-size: 1.6rem; font-weight: 600; color: var(--navy-800);
  letter-spacing: -0.01em;
}
.portal-title::before,
.portal-title::after {
  content: ""; flex: 1; height: 2px; max-width: 70px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--navy-700));
}
.portal-title::after { background: linear-gradient(90deg, var(--navy-700), transparent); }

/* ---------- Role tabs ---------- */
.role-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 30px;
}

.role-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 8px; min-width: 0;
  font: inherit; font-size: .98rem; font-weight: 600; white-space: nowrap;
  color: var(--navy-800);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .25s, color .25s, box-shadow .25s, border-color .25s, transform .15s;
}
.role-tab svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}
.role-tab:hover { border-color: var(--navy-500); }
.role-tab > span { overflow: hidden; text-overflow: ellipsis; }
.tab-extra { display: none; } /* three tabs: "Employee", "HR", "Admin" fit on every screen */
.role-tab:active { transform: translateY(1px); }
.role-tab:focus-visible { outline: none; box-shadow: var(--focus); }

.role-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-900) 100%);
  border-color: transparent;
  box-shadow: 0 10px 20px -8px rgba(7, 28, 69, .55);
}

/* ---------- Fields ---------- */
.login-form { display: grid; gap: 22px; }

.field { position: relative; }

.field__icon {
  position: absolute; left: 18px; top: 28px; transform: translateY(-50%);
  display: grid; place-items: center; color: #3a4658; pointer-events: none;
}
.field__icon svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.field input {
  width: 100%; height: 56px;
  padding: 0 54px 0 56px;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: #7d8898; }
.field input:hover { border-color: #bcc7d6; }
.field input:focus { outline: none; background: #fff; border-color: var(--navy-500); box-shadow: var(--focus); }

.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(192, 53, 43, .15); }

.field__toggle {
  position: absolute; right: 8px; top: 28px; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #3a4658; background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.field__toggle:hover { background: rgba(10, 42, 98, .06); }
.field__toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.field__toggle svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.field__toggle .icon-eye { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye { display: block; }
.field__toggle[aria-pressed="true"] .icon-eye-off { display: none; }

.field__error {
  margin: 6px 2px 0; min-height: 0;
  font-size: .85rem; color: var(--danger);
}
.field__error:empty { display: none; }

/* ---------- Alert ---------- */
.form-alert {
  margin: -6px 0 0; padding: 10px 14px;
  font-size: .9rem; border-radius: 8px;
}
.form-alert:empty { display: none; }
.form-alert.is-error   { color: var(--danger);  background: #fdecea; }
.form-alert.is-success { color: var(--success); background: #e7f5ee; }

/* ---------- Submit ---------- */
.btn-login {
  position: relative;
  height: 58px; margin-top: 10px;
  font: inherit; font-size: 1.15rem; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  border: 0; border-radius: var(--radius-md);
  box-shadow: 0 12px 22px -10px rgba(7, 28, 69, .6);
  cursor: pointer;
  transition: filter .2s, transform .15s, box-shadow .2s;
}
.btn-login:hover { filter: brightness(1.12); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: none; box-shadow: var(--focus), 0 12px 22px -10px rgba(7, 28, 69, .6); }
.btn-login[disabled] { cursor: progress; filter: saturate(.7) brightness(1.05); }

.btn-login__spinner {
  display: none;
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-login.is-loading .btn-login__label { visibility: hidden; }
.btn-login.is-loading .btn-login__spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  /* Keep the building in view on narrow screens */
  .scene { background-position: 18% bottom; }
}

@media (max-width: 520px) {
  .login-card { padding: 28px 20px 32px; border-radius: 22px; }
  .portal-title { font-size: 1.3rem; gap: 12px; }
  .role-tabs { gap: 8px; margin-bottom: 24px; }
  .role-tab { height: 48px; font-size: .84rem; gap: 5px; padding: 0 4px; white-space: nowrap; }
  .tab-extra { display: none; }
  .role-tab svg { width: 16px !important; height: 16px !important; }
  .role-tab svg { width: 20px; height: 20px; }
  .field input { height: 52px; font-size: 1rem; }
  .field__icon, .field__toggle { top: 26px; }
  .btn-login { height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* very narrow phones: text only, so all three tabs fit */
@media (max-width: 360px) {
  .role-tab svg { display: none; }
}

/* ---------- Home: Google reviews of the showrooms ---------- */
.login-col { width: 100%; max-width: 520px; display: grid; gap: 16px; }
.rv {
  padding: 20px 22px 22px; background: var(--card-bg); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px; box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: card-in .5s .1s cubic-bezier(.2,.8,.2,1) both; transition: box-shadow .3s;
}
.rv.is-flash { box-shadow: 0 0 0 4px rgba(245, 166, 35, .45), var(--shadow-card); }
.rv__head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--navy-800); }
.rv__head p { margin: 3px 0 14px; font-size: .86rem; color: var(--muted); }
.rv__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rv-shop {
  display: grid; gap: 4px; justify-items: start; padding: 12px; text-align: left;
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.rv-shop:hover { border-color: #f5a623; transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(7, 28, 69, .35); }
.rv-shop:focus-visible { outline: none; box-shadow: var(--focus); }
.rv-shop__city { font-weight: 700; color: var(--navy-800); }
.rv-shop__rate { display: flex; align-items: center; gap: 5px; }
.rv-shop__rate b { font-size: .95rem; }
.rv-shop__count { font-size: .75rem; color: var(--muted); }
.rv-shop__cta { margin-top: 4px; font-size: .76rem; font-weight: 700; color: #b26b00; }
.rv-stars { display: inline-flex; gap: 1px; }
.rv-star svg { width: 13px; height: 13px; fill: #d5dbe4; display: block; }
.rv-star.is-on svg { fill: #f5a623; }
.rv-star.is-half svg { fill: #f5c26b; }

.rv-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(7, 28, 69, .5); }
.rv-dialog::backdrop { background: rgba(7, 28, 69, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.rv-dialog__body { position: relative; padding: 26px 24px 22px; display: grid; gap: 10px; }
.rv-dialog h3 { margin: 0; font-size: 1.25rem; color: var(--navy-800); padding-right: 34px; }
.rv-addr { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.rv-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; background: #f1f4f9; border: 0; border-radius: 50%; cursor: pointer; }
.rv-x svg { width: 16px; height: 16px; fill: none; stroke: var(--navy-800); stroke-width: 2; stroke-linecap: round; }
.rv-big { justify-content: center; gap: 6px; margin: 6px 0 2px; }
.rv-big .rv-star svg { width: 34px; height: 34px; }
.rv-hint { margin: 0; font-size: .88rem; color: var(--ink); text-align: center; }
.rv-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-pick { padding: 6px 10px; font: inherit; font-size: .78rem; color: var(--navy-800); background: #f1f4f9; border: 1px solid transparent; border-radius: 999px; cursor: pointer; }
.rv-pick.is-on { background: #fff4dc; border-color: #f5a623; }
.rv-dialog textarea { width: 100%; padding: 10px 12px; font: inherit; font-size: .92rem; line-height: 1.45; color: var(--ink); background: var(--field-bg); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.rv-dialog textarea:focus { outline: none; border-color: var(--navy-500); box-shadow: var(--focus); }
.rv-note { margin: 0; min-height: 1.2em; font-size: .84rem; color: var(--success); }
.rv-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.rv-btn { height: 44px; padding: 0 16px; font: inherit; font-size: .92rem; font-weight: 700; color: #fff; background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); border: 0; border-radius: 12px; cursor: pointer; }
.rv-btn--ghost { color: var(--navy-800); background: #eef2f8; }
.rv-btn:focus-visible { outline: none; box-shadow: var(--focus); }
@media (max-width: 520px) {
  .rv { padding: 16px; border-radius: 20px; }
  .rv__list { grid-template-columns: 1fr; }
  .rv-shop { grid-template-columns: 1fr auto; align-items: center; }
  .rv-shop__count, .rv-shop__cta { grid-column: 1 / -1; }
  .rv-actions .rv-btn { flex: 1 1 100%; }
}
.rv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rv-langs { display: inline-flex; padding: 3px; background: #f1f4f9; border-radius: 999px; }
.rv-lang { height: 32px; padding: 0 12px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--navy-800); background: none; border: 0; border-radius: 999px; cursor: pointer; }
.rv-lang.is-on { color: #fff; background: linear-gradient(180deg, var(--navy-700), var(--navy-900)); }
.rv-lang:focus-visible, .rv-shuffle:focus-visible { outline: none; box-shadow: var(--focus); }
.rv-shuffle { height: 34px; padding: 0 12px; font: inherit; font-size: .82rem; font-weight: 700; color: #8a5300; background: #fff4dc; border: 1px solid #f5c26b; border-radius: 999px; cursor: pointer; }
.rv-shuffle:hover { background: #ffecc2; }
