:root {
  --navy-950: #0c2336;
  --navy-900: #12324a;
  --navy-800: #19445e;
  --teal-700: #177c82;
  --teal-600: #24939a;
  --teal-100: #dff3f2;
  --gold-500: #d5a84b;
  --white: #ffffff;
  --surface: #f5f8fa;
  --surface-strong: #eaf0f3;
  --text: #172b3a;
  --text-muted: #667985;
  --border: #dbe4e8;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --shadow:
    0 24px 70px rgba(12, 35, 54, 0.14);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      circle at top right,
      rgba(36, 147, 154, 0.12),
      transparent 34%
    ),
    var(--surface);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell,
.view {
  min-height: 100vh;
}

.loading-view {
  display: grid;
  place-content: center;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
}

.loader,
.button-loader {
  display: inline-block;
  border: 3px solid rgba(36, 147, 154, 0.18);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader {
  width: 44px;
  height: 44px;
  margin: 0 auto;
}

.button-loader {
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
}

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

.login-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(440px, 0.95fr);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(38px, 6vw, 78px);
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(
      145deg,
      rgba(12, 35, 54, 0.96),
      rgba(25, 68, 94, 0.95)
    );
}

.brand-panel::before,
.brand-panel::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.brand-panel::before {
  top: -140px;
  right: -140px;
  width: 420px;
  height: 420px;
  border: 70px solid rgba(36, 147, 154, 0.18);
}

.brand-panel::after {
  right: -100px;
  bottom: -180px;
  width: 430px;
  height: 430px;
  background: rgba(213, 168, 75, 0.08);
}

.brand-mark {
  display: grid;
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  place-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  color: var(--white);
  background:
    linear-gradient(145deg, var(--teal-600), var(--teal-700));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.08em;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 22px;
}

.brand-name {
  position: absolute;
  top: clamp(46px, 6vw, 86px);
  left: clamp(112px, 11vw, 152px);
  z-index: 1;
  margin: 0;
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.brand-category {
  position: absolute;
  top: clamp(80px, 9vw, 120px);
  left: clamp(112px, 11vw, 152px);
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

.brand-message {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: auto 0;
  padding: 80px 0;
}

.eyebrow {
  display: block;
  margin-bottom: 14px;
  color: var(--teal-600);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-message .eyebrow {
  color: #79d2d2;
}

.brand-message h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(38px, 4.7vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.brand-message p {
  max-width: 590px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.7;
}

.brand-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.brand-features div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feature-icon {
  color: #79d2d2;
  font-weight: 800;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 48px clamp(26px, 7vw, 110px) 30px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  margin: auto;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
  color: var(--navy-900);
  font-size: 24px;
  font-weight: 750;
}

.login-card h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.login-intro {
  margin: 14px 0 38px;
  color: var(--text-muted);
  line-height: 1.65;
}

.field {
  margin-bottom: 22px;
}

.field label,
.label-row {
  display: block;
  margin-bottom: 9px;
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 680;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: var(--white);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #9aa8b1;
}

.field input:focus {
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(36, 147, 154, 0.12);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 8px;
  transform: translateY(-50%);
  border: 0;
  color: var(--teal-700);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 720;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.primary-button {
  width: 100%;
  min-height: 55px;
  margin-top: 8px;
  border: 0;
  color: var(--white);
  background:
    linear-gradient(135deg, var(--teal-600), var(--teal-700));
  box-shadow: 0 13px 30px rgba(23, 124, 130, 0.2);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(23, 124, 130, 0.28);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.secondary-button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--border);
  color: var(--navy-900);
  background: var(--white);
}

.secondary-button:hover {
  border-color: var(--teal-600);
  color: var(--teal-700);
}

.message {
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 14px;
  line-height: 1.5;
}

.security-note {
  margin: 26px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.copyright {
  margin: 40px 0 0;
  color: #8b9aa3;
  font-size: 12px;
  text-align: center;
}

.dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand div:last-child {
  display: flex;
  flex-direction: column;
}

.topbar-brand strong {
  color: var(--navy-950);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.topbar-brand span {
  color: var(--text-muted);
  font-size: 11px;
}

.dashboard-content {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 70px 0 80px;
}

.welcome-block {
  margin-bottom: 42px;
}

.welcome-block h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.05em;
}

.welcome-block p {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 17px;
}

.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 62px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(36, 147, 154, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      135deg,
      rgba(223, 243, 242, 0.8),
      rgba(255, 255, 255, 0.95)
    );
  box-shadow: 0 16px 48px rgba(12, 35, 54, 0.07);
}

.card-label {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-card h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 30px;
  letter-spacing: -0.035em;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 34px;
}

.account-details div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.account-details span {
  color: var(--text-muted);
  font-size: 12px;
}

.account-details strong {
  color: var(--navy-900);
  font-size: 14px;
}

.status-active {
  color: var(--success) !important;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.modules-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
}

.module-card {
  min-height: 220px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 12px 36px rgba(12, 35, 54, 0.06);
}

.module-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  place-content: center;
  border-radius: 14px;
  color: var(--teal-700);
  background: var(--teal-100);
  font-size: 23px;
  font-weight: 800;
}

.module-card h3 {
  margin: 0 0 10px;
  color: var(--navy-950);
  font-size: 20px;
}

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

.module-status {
  display: inline-block;
  margin-top: 24px;
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.empty-modules {
  padding: 30px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--white);
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 24px clamp(22px, 5vw, 76px);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .login-layout {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 36px 24px 24px;
  }

  .mobile-brand {
    display: flex;
  }

  .account-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-details {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .login-card h2 {
    font-size: 38px;
  }

  .topbar {
    min-height: 70px;
    padding: 0 18px;
  }

  .topbar-brand span {
    display: none;
  }

  .dashboard-content {
    width: min(100% - 30px, 1180px);
    padding: 48px 0 60px;
  }

  .account-details {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dashboard-footer {
    padding: 20px 18px;
  }
}

.module-card {
  display: flex;
  flex-direction: column;
}

.module-card p {
  flex: 1;
}

.module-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 18px;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #24939a, #177c82);
  box-shadow: 0 10px 24px rgba(23, 124, 130, 0.18);
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.module-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(23, 124, 130, 0.26);
}

.module-link:focus-visible {
  outline: 3px solid rgba(36, 147, 154, 0.28);
  outline-offset: 3px;
}

.module-link {
  align-self: flex-start;
  width: auto;
  min-width: 140px;
  padding: 0 18px;
}
