:root {
  --green: #0f7a45;
  --green-dark: #075c34;
  --green-light: #22b573;
  --mint: #ecfdf4;
  --bg: #eef8f2;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 122, 69, 0.14);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

/* Login page: force phone/app style */
body.portal-login .site-footer {
  display: none !important;
}

body.portal-login .top-nav {
  display: none !important;
}

body.portal-login .menu-toggle {
  display: none !important;
}

body.portal-login .portal-container {
  width: min(430px, calc(100% - 24px)) !important;
}

body.portal-login .portal-header {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  position: relative !important;
}

body.portal-login .header-inner {
  height: 70px !important;
}

body.portal-login .brand {
  width: 100%;
  justify-content: center;
  font-size: 21px !important;
  color: #064e32 !important;
}

body.portal-login .logo {
  width: 40px !important;
  height: 40px !important;
  border-radius: 15px !important;
  box-shadow: 0 10px 24px rgba(15, 122, 69, 0.18);
}

body.portal-login .portal-main {
  min-height: calc(100vh - 70px) !important;
}

.mobile-login-page {
  min-height: calc(100vh - 70px);
  padding: 6px 12px 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app-phone {
  width: min(410px, 100%);
  min-height: 690px;
  padding: 22px 18px 18px;
  border-radius: 36px;
  background:
    radial-gradient(circle at top right, rgba(34, 181, 115, 0.20), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #f7fffb 42%, #ffffff 100%);
  border: 1px solid rgba(15, 122, 69, 0.12);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.app-phone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 78px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 122, 69, 0.16);
  transform: translateX(-50%);
}

.app-phone::after {
  content: "";
  position: absolute;
  right: -80px;
  top: 95px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(34, 181, 115, 0.10);
  z-index: 0;
}

.app-top,
.welcome-block,
.quick-stats,
.app-form {
  position: relative;
  z-index: 1;
}

.app-top {
  margin-top: 16px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0f8f4c 0%, #075c34 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.app-logo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 13px;
}

.app-name {
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

.app-sub {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 750;
  color: rgba(255,255,255,0.76);
}

.app-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 11px;
  font-weight: 950;
}

.welcome-block {
  padding: 26px 6px 0;
}

.welcome-pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf8f0;
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.welcome-block h1 {
  margin: 14px 0 0;
  max-width: 320px;
  color: var(--text);
  font-size: 31px;
  line-height: 1.04;
  letter-spacing: -0.05em;
  font-weight: 950;
}

.welcome-block p {
  margin: 12px 0 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
}

.quick-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-stat {
  min-height: 74px;
  padding: 13px 10px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(15, 122, 69, 0.10);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.quick-stat span {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.quick-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.app-form {
  margin-top: 18px;
  padding: 20px 16px 18px;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(15, 122, 69, 0.10);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}

.form-title {
  margin-bottom: 18px;
}

.form-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.form-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: #1e293b;
  font-size: 12px;
  font-weight: 950;
}

.field-box {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: .85;
  pointer-events: none;
}

.field-box input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(15, 122, 69, 0.15);
  border-radius: 18px;
  padding: 0 14px 0 42px;
  color: var(--text);
  background: #f8fcfa;
  outline: none;
  font-size: 14px;
  font-weight: 750;
  transition: .18s ease;
}

.field-box input:hover {
  border-color: rgba(15, 122, 69, 0.28);
  background: #ffffff;
}

.field-box input:focus {
  border-color: var(--green);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 122, 69, 0.11);
}

.password-box input {
  padding-right: 76px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  height: 36px;
  min-width: 58px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 14px;
  background: #eaf8f0;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.toggle-password:hover {
  background: #d9f5e5;
}

.form-row {
  margin: 6px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.forgot-link {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 950;
  text-decoration: none;
}

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

.login-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f8f4c 0%, #075c34 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 15px 30px rgba(15, 122, 69, 0.24);
  transition: .18s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 36px rgba(15, 122, 69, 0.30);
}

.login-btn span {
  font-size: 18px;
  line-height: 1;
}

.request-line {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
}

.request-line a {
  margin-left: 5px;
  color: var(--green);
  font-weight: 950;
  text-decoration: none;
}

.request-line a:hover {
  text-decoration: underline;
}

.alert {
  margin-bottom: 15px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #b42318;
  background: #fff1f1;
  border: 1px solid #f9d1d1;
  font-size: 13px;
  font-weight: 800;
}

.field-error {
  margin-top: 6px;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 430px) {
  .mobile-login-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .app-phone {
    border-radius: 30px;
    min-height: auto;
  }

  .welcome-block h1 {
    font-size: 28px;
  }

  .quick-stats {
    gap: 8px;
  }

  .quick-stat {
    border-radius: 18px;
  }
}

@media (max-width: 360px) {
  .quick-stats {
    display: none;
  }

  .welcome-block h1 {
    font-size: 25px;
  }

  .app-form {
    margin-top: 16px;
  }
}