@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #23b8ae;
  --primary-dark: #15988f;
  --navy: #15223b;
  --muted: #718096;
  --border: #e2e8f0;
  --surface: #ffffff;
  --danger: #d64545;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--navy);
  background: #f7fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand-logo {
  font-family: 'Outfit', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
}

.topbar {
  width: min(1160px, calc(100% - 40px));
  min-height: 74px;
  margin: 18px auto 0;
  padding: 12px 16px 12px 22px;
  display: flex;
  align-items: center;
  gap: 32px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(21, 34, 59, 0.08);
  position: relative;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand__mark {
  width: 32px;
  height: 32px;
  display: inline-block;
  border-radius: 6px;
  color: transparent;
  background: url('../images/logo.png') no-repeat center center;
  background-size: contain;
  overflow: hidden;
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 30px;
  color: #536176;
  font-size: 13px;
  font-weight: 600;
}

.topbar__nav a:hover {
  color: var(--primary-dark);
}

.topbar__button {
  padding: 11px 20px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.auth-shell {
  width: min(1160px, calc(100% - 40px));
  min-height: 620px;
  margin: 24px auto 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 118px 70px 72px;
}

.auth-form-wrap {
  width: min(100%, 390px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

h1 {
  margin: 0;
  font-size: clamp(29px, 3vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 13px 0 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.demo-account {
  margin: -17px 0 26px;
  padding: 13px 15px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(35, 184, 174, 0.24);
  border-radius: 11px;
  color: #536176;
  background: rgba(35, 184, 174, 0.07);
  font-size: 12px;
}

.demo-account strong {
  margin-bottom: 2px;
  color: var(--primary-dark);
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: inline-block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}

.field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field__label-row a {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(35, 184, 174, 0.12);
}

.field input.is-invalid {
  border-color: var(--danger);
}

.field__error {
  min-height: 16px;
  display: block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 11px;
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 66px;
}

.password-toggle {
  border: 0;
  padding: 5px;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.remember {
  margin: 2px 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #536176;
  font-size: 12px;
  cursor: pointer;
}

.remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.remember__switch {
  width: 35px;
  height: 19px;
  padding: 3px;
  display: flex;
  border-radius: 999px;
  background: #cbd5e0;
  transition: background 160ms ease;
}

.remember__switch::after {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 160ms ease;
}

.remember input:checked + .remember__switch {
  background: var(--primary);
}

.remember input:checked + .remember__switch::after {
  transform: translateX(16px);
}

.submit-button {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #2bc8bc, #1caaa1);
  box-shadow: 0 12px 24px rgba(35, 184, 174, 0.23);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(35, 184, 174, 0.3);
}

.form-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--primary-dark);
  font-size: 12px;
  text-align: center;
}

.form-message.is-error {
  color: var(--danger);
}

.access-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.access-note a {
  color: var(--primary-dark);
  font-weight: 600;
}

.brand-panel {
  min-height: 620px;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.26), transparent 24%),
    linear-gradient(145deg, #4ed6cb 0%, #22b9af 48%, #159f98 100%);
  isolation: isolate;
}

.brand-panel::before,
.brand-panel::after {
  width: 620px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  position: absolute;
  content: "";
  transform: rotate(-53deg);
}

.brand-panel::before {
  top: 30px;
  left: -165px;
}

.brand-panel::after {
  right: -185px;
  bottom: 30px;
}

.brand-panel__orb {
  border-radius: 50%;
  position: absolute;
  filter: blur(3px);
  opacity: 0.35;
}

.brand-panel__orb--one {
  width: 300px;
  height: 300px;
  top: -90px;
  right: -80px;
  background: #b5fff8;
}

.brand-panel__orb--two {
  width: 250px;
  height: 250px;
  left: -90px;
  bottom: -70px;
  background: #008d87;
}

.brand-panel__line {
  width: 760px;
  height: 1px;
  position: absolute;
  background: rgba(255, 255, 255, 0.17);
  transform: rotate(-55deg);
}

.brand-panel__line--one {
  top: 44%;
  left: -165px;
}

.brand-panel__line--two {
  right: -160px;
  bottom: 32%;
}

.brand-panel__content {
  width: min(78%, 410px);
  position: relative;
  z-index: 2;
  text-align: center;
}

.brand-panel__logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 25px;
  color: transparent;
  background: rgba(255, 255, 255, 0.16) url('../images/logo.png') no-repeat center center;
  background-size: 80%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.brand-panel__name {
  margin: 0;
  font-size: clamp(42px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.brand-panel__description {
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 24px;
  line-height: 1.6;
}

footer {
  width: min(1160px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: #8a96a8;
  font-size: 11px;
}

footer div {
  display: flex;
  gap: 24px;
}

@media (max-width: 860px) {
  .topbar {
    gap: 16px;
  }

  .topbar__nav {
    display: none;
  }

  .topbar__button {
    margin-left: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    margin-top: 20px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(21, 34, 59, 0.08);
  }

  .auth-form-panel {
    padding: 64px 30px;
  }

  .brand-panel {
    min-height: 390px;
    grid-row: 1;
  }
}

@media (max-width: 540px) {
  .topbar,
  .auth-shell,
  footer {
    width: min(100% - 24px, 1160px);
  }

  .topbar {
    min-height: 62px;
    margin-top: 12px;
    padding: 10px 12px;
  }

  .topbar__button {
    display: none;
  }

  .auth-form-panel {
    padding: 48px 22px;
  }

  .brand-panel {
    min-height: 310px;
  }

  footer {
    padding: 24px 0;
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================
   Dark Mode Specific Overrides for Auth Page
   ========================================== */

[data-theme="dark"] body {
  background: #0b1329 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .topbar {
  background: rgba(17, 30, 59, 0.92) !important;
  border-color: #1e293b !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .topbar__nav {
  color: #94a3b8 !important;
}

[data-theme="dark"] .topbar__button {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .auth-shell {
  background: #111e3b !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid #1e293b !important;
}

[data-theme="dark"] .eyebrow {
  color: #23b8ae !important;
}

[data-theme="dark"] h1 {
  color: #ffffff !important;
}

[data-theme="dark"] .subtitle {
  color: #94a3b8 !important;
}

[data-theme="dark"] .demo-account {
  background: rgba(35, 184, 174, 0.12) !important;
  border-color: rgba(35, 184, 174, 0.3) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .demo-account strong {
  color: #23b8ae !important;
}

[data-theme="dark"] .field label {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .field input {
  background: #0b1329 !important;
  color: #f1f5f9 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .field input:focus {
  border-color: #23b8ae !important;
  box-shadow: 0 0 0 4px rgba(35, 184, 174, 0.2) !important;
}

[data-theme="dark"] .password-toggle {
  color: #23b8ae !important;
}

[data-theme="dark"] .remember {
  color: #94a3b8 !important;
}

[data-theme="dark"] .access-note {
  color: #94a3b8 !important;
}

[data-theme="dark"] .access-note a {
  color: #23b8ae !important;
}

[data-theme="dark"] footer {
  color: #64748b !important;
}

[data-theme="dark"] .demo-account span[data-i18n="login-demo-principal"] {
  background: rgba(191, 219, 254, 0.15) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .demo-account span[data-i18n="login-demo-admin"] {
  background: rgba(24, 115, 232, 0.15) !important;
  color: #a8cdfc !important;
}
