:root {
  color-scheme: light;
  --primary: #0f3057;
  --primary-strong: #0a233f;
  --accent: #4ca5d7;
  --bg-light: #f7f9fc;
  --bg-panel: #ffffff;
  --bg-muted: #eef2f7;
  --text-main: #0f1f2e;
  --text-muted: #586778;
  --border: #dbe2ea;
  --shadow: 0 24px 50px rgba(15, 48, 87, 0.16);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

html.theme-dark {
  color-scheme: dark;
  --bg-light: #0f172a;
  --bg-panel: #101c2f;
  --bg-muted: #1c2637;
  --text-main: #f5f7fb;
  --text-muted: #9eacbf;
  --border: #1f2b3f;
  --shadow: 0 22px 48px rgba(3, 9, 21, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg-light);
  color: var(--text-main);
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 165, 215, 0.2), transparent 70%);
  filter: blur(40px);
  z-index: 0;
}

.page::before {
  top: -15vw;
  left: -15vw;
}

.page::after {
  bottom: -15vw;
  right: -15vw;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(15, 48, 87, 0.08) 1px, transparent 0);
  background-size: 36px 36px;
  opacity: 0.6;
  z-index: 0;
}

html.theme-dark .bg-grid {
  background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.07) 1px, transparent 0);
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 80px;
  flex: 1;
}

.login-layout {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(320px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.card-header {
  text-align: center;
  margin-bottom: 26px;
}

.card-header img {
  height: 88px;
  width: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.06));
}

.card-eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  font-weight: 600;
}

.card-title {
  margin: 12px 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.card-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell span {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--text-muted);
}

.input-shell input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-shell input:focus {
  outline: none;
  border-color: rgba(76, 165, 215, 0.6);
  box-shadow: 0 0 0 3px rgba(76, 165, 215, 0.2);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox-row input {
  accent-color: var(--primary);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}

.link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

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

.button {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 18px 24px rgba(15, 48, 87, 0.2);
}

.button:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
}

.alert.success {
  background: rgba(31, 179, 124, 0.12);
  color: #0f6b48;
  border: 1px solid rgba(31, 179, 124, 0.4);
}

.alert.error {
  background: rgba(231, 76, 60, 0.12);
  color: #b03a2e;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

html.theme-dark .alert.success {
  color: #9ff1cc;
  border-color: rgba(76, 214, 162, 0.5);
}

html.theme-dark .alert.error {
  color: #f6b2a8;
  border-color: rgba(241, 99, 95, 0.5);
}

.support-row {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.company-card {
  background: linear-gradient(180deg, rgba(15, 48, 87, 0.98), rgba(10, 35, 63, 0.98));
  color: #f5f7fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 50px rgba(10, 24, 44, 0.22);
  padding: 30px 28px;
  display: grid;
  gap: 18px;
}

.company-card-header {
  display: grid;
  gap: 10px;
}

.company-card .card-eyebrow {
  color: rgba(245, 247, 251, 0.72);
}

.company-card-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.company-card-subtitle {
  margin: 0;
  color: rgba(245, 247, 251, 0.76);
  font-size: 14px;
  line-height: 1.6;
}

.company-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.company-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 247, 251, 0.62);
}

.company-logo-shell {
  min-height: 92px;
  border-radius: 16px;
  background: rgba(3, 11, 22, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 22px;
}

.company-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.company-logo-tecnoscan {
  max-height: 60px;
}

.company-logo-fit360 {
  max-height: 66px;
}

.company-details {
  display: grid;
  gap: 4px;
  color: rgba(245, 247, 251, 0.84);
  font-size: 13px;
  line-height: 1.55;
}

.company-details strong {
  color: #fff;
  font-size: 14px;
}

.site-footer {
  z-index: 1;
  padding: 26px 20px 32px;
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

html.theme-dark .site-footer {
  background: rgba(8, 14, 24, 0.7);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 12px 18px rgba(10, 24, 44, 0.15);
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.page-meta {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

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

.page-meta a:hover {
  text-decoration: underline;
}

.success-panel {
  display: none;
  text-align: center;
  background: rgba(31, 179, 124, 0.1);
  border: 1px solid rgba(31, 179, 124, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.success-panel span {
  font-size: 36px;
  color: #1fb37c;
  display: inline-flex;
  margin-bottom: 12px;
}

.success-panel h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.success-panel p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.success-panel.active {
  display: block;
}

.strength {
  margin-top: 12px;
}

.strength-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  font-weight: 600;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.strength-bars span {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.strength-bars span.active {
  background: var(--accent);
}

.hidden {
  display: none;
}

.legal-shell {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 40px));
  margin: 56px auto 80px;
}

.legal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 36px;
}

.legal-header {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.legal-kicker {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  font-weight: 700;
}

.legal-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.legal-subtitle {
  margin: 0;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.legal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 26px;
}

.legal-content {
  display: grid;
  gap: 24px;
}

.legal-section {
  display: grid;
  gap: 12px;
}

.legal-section h2 {
  margin: 0;
  font-size: 20px;
}

.legal-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.72;
  color: var(--text-main);
}

.legal-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text-main);
}

.legal-section li {
  font-size: 14px;
  line-height: 1.68;
}

.legal-note {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.legal-aside {
  display: grid;
  gap: 18px;
  align-content: start;
}

.legal-panel {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.legal-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.legal-panel p,
.legal-panel li {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

.legal-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.legal-panel a,
.legal-section a,
.site-footer a {
  color: var(--primary);
}

html.theme-dark .legal-note,
html.theme-dark .legal-panel {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 640px) {
  .shell {
    padding: 40px 16px 60px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .company-card {
    padding: 24px 20px;
  }

  .card-title {
    font-size: 22px;
  }

  .company-card-title {
    font-size: 22px;
  }

  .site-footer {
    letter-spacing: 0.12em;
  }

  .legal-shell {
    width: min(100% - 24px, 980px);
    margin: 28px auto 48px;
  }

  .legal-card {
    padding: 26px 20px;
  }

  .legal-title {
    font-size: 28px;
  }
}

@media (max-width: 860px) {
  .login-layout {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .auth-card {
    width: 100%;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }
}
