:root {
  --page-bg: #f5f7fb;
  --panel-bg: #ffffff;
  --ink: #172033;
  --muted: #687386;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --line: #d9e1ea;
  --soft: #e8f4f2;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f8fafc 0%, var(--page-bg) 58%, #edf2f7 100%);
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 10px 28px rgba(22, 32, 51, 0.06);
}

.app-navbar .navbar-brand {
  font-weight: 700;
  color: var(--ink);
}

.brand-icon-sm {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
}

.app-navbar .nav-link {
  color: var(--muted);
  border-radius: 6px;
  font-weight: 600;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  color: var(--brand-dark);
  background: var(--soft);
}

.user-menu {
  border: 1px solid var(--line);
}

.flash-container {
  margin-top: 24px;
}

.auth-shell {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 24px 70px rgba(22, 32, 51, 0.14);
}

.auth-aside {
  min-height: 620px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(rgba(15, 118, 110, 0.90), rgba(12, 82, 78, 0.94)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1200&q=80") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.aside-copy h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.aside-copy p {
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  margin: 0;
}

.auth-panel {
  padding: 42px;
  display: flex;
  align-items: center;
}

.auth-inner {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 28px;
}

.auth-tab {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.auth-tab:hover,
.auth-tab.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 4px 16px rgba(22, 32, 51, 0.08);
}

.form-title {
  margin-bottom: 6px;
  font-size: 1.65rem;
}

.form-subtitle {
  margin-bottom: 24px;
  color: var(--muted);
}

.input-group-text {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.form-control {
  min-height: 48px;
  border-color: var(--line);
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.16);
}

.btn-brand {
  min-height: 48px;
  border: 0;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
}

.btn-brand:hover,
.btn-brand:focus {
  color: #fff;
  background: var(--brand-dark);
}

.password-toggle {
  min-width: 48px;
  border-color: var(--line);
  color: var(--muted);
  background: #fff;
}

.password-toggle:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--soft);
}

.password-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.password-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #dc3545;
  transition: width 220ms ease, background 220ms ease;
}

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

  .auth-aside {
    min-height: 300px;
    padding: 30px;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 0;
  }

  .auth-layout {
    min-height: calc(100vh - 66px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .auth-panel,
  .auth-aside {
    padding: 24px;
  }

  .auth-small-row {
    align-items: flex-start !important;
    flex-direction: column;
  }
}
