:root {
  --green: #087f5b;
  --green-dark: #05684d;
  --green-deep: #075b51;
  --teal: #07526c;
  --navy: #13234f;
  --ink: #172033;
  --text: #334155;
  --muted: #6b778c;
  --border: #dce6eb;
  --field: #f4f8fc;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --shadow: 0 30px 90px rgba(15, 23, 42, .15);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.secure-login-page {
  min-height: 100vh;
  padding: clamp(14px, 2.2vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 6% 2%, rgba(8, 127, 91, .14), transparent 31%),
    radial-gradient(circle at 96% 100%, rgba(7, 82, 108, .10), transparent 28%),
    linear-gradient(135deg, #f8fbfa 0%, #edf4f6 100%);
}
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
svg { width: 1em; height: 1em; fill: currentColor; display: block; }

.auth-shell {
  width: min(1220px, 100%);
  height: min(710px, calc(100vh - clamp(28px, 4.4vw, 60px)));
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(211, 223, 229, .9);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(38px, 4.2vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  color: #fff;
  background: linear-gradient(145deg, #087f5b 0%, #076a61 46%, #07526c 100%);
}
.brand-orb { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.brand-orb-one { width: 360px; height: 360px; right: -130px; top: -155px; background: rgba(255,255,255,.055); }
.brand-orb-two { width: 290px; height: 290px; left: -120px; bottom: -125px; background: rgba(255,255,255,.05); }
.brand-grid {
  position: absolute; inset: 0; z-index: -2; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom right, transparent, #000 40%, transparent 90%);
}
.brand-main { position: relative; z-index: 1; }
.brand-logo-box {
  width: 108px; height: 108px; margin-bottom: 24px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.48); border-radius: 24px;
  background: #fff; box-shadow: 0 16px 38px rgba(0,0,0,.17);
}
.brand-logo { width: 92px; height: 92px; object-fit: contain; border-radius: 18px; }
.brand-kicker {
  display: inline-flex; margin-bottom: 10px; color: rgba(255,255,255,.74);
  font-size: 10px; font-weight: 800; letter-spacing: 1.25px;
}
.brand-panel h1 {
  margin: 0; max-width: 560px; font-size: clamp(31px, 3.3vw, 47px);
  line-height: 1.12; letter-spacing: -.9px; font-weight: 800;
}
.brand-panel > .brand-main > p {
  max-width: 540px; margin: 18px 0 0; color: rgba(255,255,255,.82);
  font-size: 15px; line-height: 1.72;
}
.security-features { display: grid; gap: 10px; position: relative; z-index: 1; }
.security-card {
  min-height: 72px; padding: 12px 14px;
  display: flex; align-items: center; gap: 13px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 15px;
  background: rgba(255,255,255,.075); backdrop-filter: blur(5px);
}
.security-icon {
  width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center;
  border-radius: 12px; color: #fff; background: rgba(255,255,255,.13);
}
.security-icon svg { width: 20px; height: 20px; }
.security-card strong { display: block; margin-bottom: 3px; color: #fff; font-size: 13px; font-weight: 750; }
.security-card small { display: block; color: rgba(255,255,255,.72); font-size: 10.7px; line-height: 1.43; }
.brand-footer { position: absolute; left: clamp(38px, 4.2vw, 58px); bottom: 15px; display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.5); font-size: 9.5px; letter-spacing: .3px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #76e2bb; box-shadow: 0 0 0 4px rgba(118,226,187,.12); }

.login-panel { min-width: 0; padding: clamp(34px, 4vw, 56px); display: flex; align-items: center; background: #fff; }
.login-wrap { width: 100%; max-width: 430px; margin: auto; }
.mobile-logo { display: none; }
.secure-badge {
  width: fit-content; margin-bottom: 17px; padding: 7px 12px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; color: var(--green); background: #eaf8f3;
  font-size: 10px; font-weight: 800; letter-spacing: .65px;
}
.secure-badge svg { width: 13px; height: 13px; }
.login-panel h2 { margin: 0; color: var(--navy); font-size: clamp(30px, 3vw, 38px); line-height: 1.15; letter-spacing: -.65px; font-weight: 800; }
.login-subtitle { margin: 9px 0 25px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.notice-stack { display: grid; gap: 8px; margin: -4px 0 16px; }
.notice { padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid; border-radius: 11px; font-size: 11.5px; line-height: 1.45; }
.notice-icon { flex: 0 0 auto; margin-top: 1px; }
.notice-icon svg { width: 16px; height: 16px; }
.notice-error { color: var(--danger); border-color: #fecaca; background: var(--danger-bg); }
.notice-success { color: var(--success); border-color: #a6f4c5; background: var(--success-bg); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; color: #29364b; font-size: 12px; font-weight: 750; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; height: 55px; padding: 0 50px 0 47px;
  border: 1px solid var(--border); border-radius: 13px; outline: 0;
  color: #121b2c; background: #f7fafc; font-size: 13.5px; font-weight: 500;
  transition: .18s ease;
}
.input-wrap input::placeholder { color: #9aa7b8; font-weight: 450; }
.input-wrap input:hover { border-color: #bccbd3; background: #fff; }
.input-wrap input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(8,127,91,.09); }
.field-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  z-index: 2; color: #7b8ba0; pointer-events: none;
}
.field-icon svg { width: 17px; height: 17px; }
.password-wrap input { padding-left: 58px; padding-right: 58px; background: #eef4ff; border-color: #cfdae7; font-weight: 600; }
.password-wrap .lock-icon {
  left: 9px; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: #fff; background: var(--green);
}
.password-wrap .lock-icon svg { width: 17px; height: 17px; }
.password-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
  border: 1px solid rgba(8,127,91,.17); border-radius: 50%; cursor: pointer;
  color: var(--green); background: #fff; box-shadow: 0 3px 10px rgba(8,127,91,.08);
  transition: .16s ease;
}
.password-eye:hover { background: #eaf8f3; border-color: rgba(8,127,91,.36); }
.password-eye:focus-visible { outline: 3px solid rgba(8,127,91,.18); outline-offset: 2px; }
.password-eye svg { width: 19px; height: 19px; }
.password-eye .eye-closed { display: none; }
.password-eye.is-visible { color: #fff; background: var(--green); border-color: var(--green); }
.password-eye.is-visible .eye-open { display: none; }
.password-eye.is-visible .eye-closed { display: block; }

.login-button {
  width: 100%; height: 56px; margin-top: 3px; padding: 0 22px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: 13px; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #099568, #087f5b 55%, #066b51);
  box-shadow: 0 12px 24px rgba(8,127,91,.22);
  font-size: 13.5px; font-weight: 800; letter-spacing: .1px;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.login-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(8,127,91,.28); }
.login-button:active:not(:disabled) { transform: translateY(0); }
.login-button:disabled { cursor: wait; opacity: .78; }
.button-icon svg { width: 18px; height: 18px; }
.login-button.is-loading .button-icon { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.login-button.is-loading .button-icon svg { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.policy-box { margin-top: 20px; padding: 13px 14px; border: 1px solid #e4eaef; border-radius: 12px; background: #f8fafc; }
.policy-title { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #304056; font-size: 11px; font-weight: 800; }
.policy-shield { color: var(--green); }
.policy-shield svg { width: 15px; height: 15px; }
.policy-box p { margin: 0; color: #718096; font-size: 9.8px; line-height: 1.58; }
.roles-note { margin: 12px 2px 0; color: #9aa5b5; text-align: center; font-size: 9px; line-height: 1.45; }

.restriction-modal[hidden] { display: none !important; }
.restriction-modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 18px; }
.restriction-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.58); backdrop-filter: blur(4px); }
.restriction-dialog {
  position: relative; z-index: 1; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow: auto;
  padding: 28px; border: 1px solid rgba(255,255,255,.8); border-radius: 23px; background: #fff;
  box-shadow: 0 30px 90px rgba(15,23,42,.3); animation: modal-in .18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #7d8898; background: #f4f6f8; cursor: pointer; font-size: 23px; line-height: 1; }
.modal-warning-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; color: #b54708; background: #fff3e7; }
.modal-warning-icon svg { width: 28px; height: 28px; }
.restriction-dialog h3 { margin: 0; color: var(--navy); text-align: center; font-size: 23px; font-weight: 800; }
.restriction-intro { margin: 11px 0 15px; padding: 11px 13px; border-radius: 11px; color: #9a3412; background: #fff7ed; font-size: 11.5px; line-height: 1.55; }
.restriction-grid { display: grid; gap: 8px; }
.restriction-row { padding: 10px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid #e7edf1; border-radius: 11px; background: #f8fafc; }
.restriction-row-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: #eaf8f3; }
.restriction-row-icon svg { width: 17px; height: 17px; }
.restriction-row small { display: block; margin-bottom: 2px; color: #94a3b8; font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; }
.restriction-row strong { display: block; color: #334155; font-size: 11.5px; font-weight: 700; overflow-wrap: anywhere; }
.release-box { margin-top: 10px; padding: 11px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #fed7aa; border-radius: 11px; color: #9a3412; background: #fff7ed; }
.release-icon { margin-top: 1px; }
.release-icon svg { width: 17px; height: 17px; }
.release-box strong { display: block; margin-bottom: 2px; font-size: 9px; text-transform: uppercase; letter-spacing: .4px; }
.release-box p { margin: 0; font-size: 10.5px; line-height: 1.5; }
.restriction-advice { margin: 12px 0 0; padding-top: 11px; border-top: 1px solid #e7edf1; color: #64748b; font-size: 10px; line-height: 1.55; }
.modal-confirm { width: 100%; height: 44px; margin-top: 15px; border: 0; border-radius: 10px; color: #fff; background: var(--green); cursor: pointer; font-size: 12px; font-weight: 750; }

@media (max-width: 930px) {
  body.secure-login-page { padding: 14px; }
  .auth-shell { display: block; width: min(530px, 100%); height: auto; min-height: 0; border-radius: 24px; }
  .brand-panel { display: none; }
  .login-panel { min-height: min(700px, calc(100vh - 28px)); padding: 38px 34px; }
  .mobile-logo { width: 86px; height: 86px; object-fit: contain; margin: 0 auto 17px; padding: 5px; display: block; border: 1px solid #e4eaef; border-radius: 18px; background: #fff; }
  .secure-badge { display: flex; margin: 0 auto 14px; }
  .login-panel h2, .login-subtitle { text-align: center; }
}

@media (max-width: 520px) {
  body.secure-login-page { padding: 0; background: #fff; }
  .auth-shell { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-panel { min-height: 100vh; padding: 28px 21px calc(24px + env(safe-area-inset-bottom)); }
  .login-wrap { max-width: 430px; }
  .mobile-logo { width: 78px; height: 78px; margin-bottom: 14px; }
  .login-panel h2 { font-size: 29px; }
  .login-subtitle { margin-bottom: 21px; }
  .input-wrap input, .login-button { height: 53px; }
  .policy-box { margin-top: 17px; }
  .restriction-dialog { padding: 23px 17px 18px; border-radius: 19px; }
}

@media (max-height: 680px) and (min-width: 931px) {
  .auth-shell { min-height: 570px; }
  .brand-panel { padding-top: 34px; padding-bottom: 34px; }
  .brand-logo-box { width: 88px; height: 88px; margin-bottom: 16px; }
  .brand-logo { width: 74px; height: 74px; }
  .brand-panel h1 { font-size: 36px; }
  .brand-panel > .brand-main > p { margin-top: 11px; font-size: 13px; }
  .security-card { min-height: 62px; padding: 9px 12px; }
  .security-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .login-panel { padding-top: 28px; padding-bottom: 28px; }
  .secure-badge { margin-bottom: 11px; }
  .login-subtitle { margin-bottom: 18px; }
  .form-group { margin-bottom: 13px; }
  .policy-box { margin-top: 15px; padding: 10px 12px; }
  .roles-note { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
