html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

body:not(.auth-page) {
  margin: 0;
  min-height: 100vh;
  background: #f4f7fb;
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f6f8fc 0%, #eef2f8 100%);
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
}

.auth-page-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(23, 32, 51, 0.08);
  padding: 32px;
}

.auth-card-wide {
  max-width: 640px;
  margin: 0 auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.auth-header p {
  margin: 0;
  color: #5b6474;
  line-height: 1.5;
}

.auth-eyebrow {
  margin-bottom: 12px !important;
  color: #3057d5 !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  font-weight: 600;
}

.form-field input,
.form-field select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #c7d0e0;
  border-radius: 8px;
  font-size: 1rem;
  color: #172033;
  background: #ffffff;
  box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #3057d5;
  box-shadow: 0 0 0 4px rgba(48, 87, 213, 0.14);
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5b6474;
}

.auth-submit {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #3057d5;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
}

.auth-submit:hover {
  background: #2747af;
}

.auth-validation {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #efc1c1;
  border-radius: 8px;
  background: #fff5f5;
  color: #a12626;
}

.auth-validation:empty {
  display: none;
}

.field-error {
  color: #b42318;
  font-size: 0.875rem;
}

.auth-switch {
  margin: 20px 0 0;
  text-align: center;
  color: #5b6474;
}

.auth-switch a {
  color: #3057d5;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-header {
  border-bottom: 1px solid #d7deea;
  background: #ffffff;
}

.app-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.app-brand {
  color: #172033;
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
}

.app-nav-links,
.app-nav-account,
.account-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-nav-links {
  flex: 1 1 auto;
}

.app-nav-account {
  margin-left: auto;
}

.nav-link,
.secondary-link {
  color: #42506a;
  text-decoration: none;
  font-weight: 600;
}

.nav-link-active,
.nav-link:hover,
.secondary-link:hover,
.app-brand:hover {
  color: #3057d5;
}

.account-greeting {
  color: #5b6474;
  font-size: 0.95rem;
}

.nav-button {
  border: 1px solid #c7d0e0;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
}

.nav-button:hover {
  border-color: #3057d5;
  color: #3057d5;
}

.app-main-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.app-main {
  min-width: 0;
}

.flash-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #cfe0c8;
  border-radius: 8px;
  background: #f4fbf1;
  color: #255b21;
  font-weight: 600;
}

.page-shell {
  display: grid;
  gap: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-tight {
  align-items: start;
}

.page-eyebrow {
  margin: 0 0 10px;
  color: #3057d5;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-header h1,
.section-title,
.approval-row h3,
.portal-card h2,
.empty-state h2 {
  margin: 0;
}

.page-subtitle,
.section-copy,
.approval-row p,
.portal-card-meta,
.empty-state p {
  margin: 8px 0 0;
  color: #5b6474;
  line-height: 1.5;
}

.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #3057d5;
  color: #ffffff;
  font-weight: 700;
  padding: 12px 16px;
  text-decoration: none;
}

.page-action:hover,
.auth-submit:hover {
  background: #2747af;
}

.content-card,
.portal-card,
.empty-state {
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
  padding: 24px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.portal-card {
  display: grid;
  gap: 18px;
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.portal-details {
  margin: 0;
  display: grid;
  gap: 12px;
}

.portal-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef2f8;
  padding-top: 12px;
}

.portal-details div:first-child {
  border-top: 0;
  padding-top: 0;
}

.portal-details dt {
  color: #5b6474;
}

.portal-details dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge-active {
  background: #eef8ea;
  color: #246b1f;
}

.status-badge-muted {
  background: #eef2f8;
  color: #506078;
}

.portal-card-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.empty-inline {
  border: 1px dashed #c7d0e0;
  border-radius: 8px;
  padding: 16px;
  color: #5b6474;
}

.empty-inline p {
  margin: 0;
}

.approval-list {
  display: grid;
  gap: 14px;
}

.approval-row {
  display: grid;
  gap: 14px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 16px;
  background: #f8faff;
}

.approval-row-main {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  flex-wrap: wrap;
}

.approval-row-main > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.approval-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.approval-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.approval-meta dt {
  color: #5b6474;
}

.approval-meta dd {
  margin: 0;
  font-weight: 600;
}

.inline-form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.danger-link {
  color: #b42318;
}

.success-link {
  color: #246b1f;
}

.form-page-grid {
  display: grid;
  gap: 24px;
}

.toggle-field {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #f8faff;
}

.toggle-field input {
  margin-top: 4px;
}

.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field small {
  margin-top: 4px;
  color: #5b6474;
  line-height: 1.4;
}

.pricing-editor {
  display: grid;
  gap: 16px;
  border-top: 1px solid #eef2f8;
  padding-top: 20px;
}

.pricing-list {
  display: grid;
  gap: 12px;
}

.pricing-row {
  display: grid;
  gap: 12px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #f8faff;
  padding: 14px;
}

.pricing-row strong,
.pricing-row small,
.pricing-fields span {
  display: block;
}

.pricing-row small {
  margin-top: 4px;
  color: #5b6474;
}

.pricing-fields {
  display: grid;
  gap: 12px;
}

.pricing-fields label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.pricing-fields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #c7d0e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.pricing-fields input:focus {
  outline: none;
  border-color: #3057d5;
  box-shadow: 0 0 0 4px rgba(48, 87, 213, 0.14);
}

@media (min-width: 900px) {
  .form-page-grid {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }

  .pricing-row {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    align-items: center;
  }

  .pricing-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .app-main-shell,
  .app-nav,
  .auth-page-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-nav-account {
    margin-left: 0;
    width: 100%;
  }

  .portal-details div {
    flex-direction: column;
  }

  .portal-details dd {
    text-align: left;
  }
}
