:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "Segoe UI", Arial, sans-serif;
  color: #1d1d1f;
  background: #f5f5f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(11, 107, 71, .055), transparent 34%),
    #f5f5f7;
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 24px 78px;
}

.login-panel {
  width: min(440px, 100%);
}

.brand {
  text-align: center;
  margin-bottom: 30px;
}

.product-name {
  margin: 0;
  color: #1d1d1f;
  font-size: clamp(31px, 6vw, 42px);
  line-height: 1;
  letter-spacing: -.052em;
  white-space: nowrap;
}

.wordmark-electronic {
  font-weight: 350;
}

.wordmark-permit {
  font-weight: 720;
}

.login-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .065);
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .075),
    0 2px 8px rgba(0, 0, 0, .025);
  padding: 34px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.heading { margin-bottom: 25px; }

h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 650;
}

.subtitle {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #3a3a3c;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 0 14px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, .96);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:hover { border-color: #b8b8bd; }

input:focus {
  border-color: #0b6b47;
  box-shadow: 0 0 0 4px rgba(11, 107, 71, .10);
  background: #fff;
}

#loginButton {
  width: 100%;
  height: 48px;
  margin-top: 3px;
  border: 0;
  border-radius: 12px;
  background: #0b6b47;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(11, 107, 71, .16);
  transition: transform .12s ease, background .18s ease, opacity .18s ease;
}

#loginButton:hover { background: #095d3e; }
#loginButton:active { transform: scale(.992); }
#loginButton:disabled { opacity: .62; cursor: wait; }

.error {
  margin: -2px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(162, 38, 38, .10);
  border-radius: 10px;
  background: #fff2f2;
  color: #a22626;
  font-size: 13px;
  line-height: 1.4;
}

.note {
  margin: 22px 0 0;
  padding-top: 19px;
  border-top: 1px solid #ececee;
  color: #86868b;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Language selector – same visual language as the rest of PTW */
.language-picker {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 1000;
}

.language-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(60, 60, 67, .15);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
  color: #1d1d1f;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .035);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.language-button b { font-size: 11px; }

.language-button > span:not(.chevron) {
  color: #6e6e73;
  font-size: 11px;
}

.chevron {
  margin-left: 1px;
  color: #86868b;
  font-size: 14px;
  transform: translateY(-1px);
}

.language-flag {
  width: 25px;
  height: 17px;
  object-fit: cover;
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 3px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 270px;
  max-height: none;
  overflow: visible;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 17px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 20px 56px rgba(0, 0, 0, .16);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.language-menu.open { display: grid; }

.language-option {
  display: grid;
  grid-template-columns: 28px 32px 1fr 18px;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.language-option:hover,
.language-option.active {
  background: rgba(11, 107, 71, .08);
}

.language-option-code {
  font-size: 11px;
  font-weight: 800;
}

.language-option-name {
  color: #6e6e73;
  font-size: 12px;
}

.language-option-check {
  visibility: hidden;
  color: #0b6b47;
  font-weight: 800;
}

.language-option.active .language-option-check { visibility: visible; }

.security-footer {
  position: fixed;
  left: 50%;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  color: #9a9a9f;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.lock-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 520px) {
  .language-picker {
    top: 14px;
    right: 14px;
  }

  .language-button > span:not(.chevron) { display: none; }

  .login-shell {
    padding: 82px 17px 74px;
  }

  .brand { margin-bottom: 24px; }

  .login-card {
    padding: 27px 22px;
    border-radius: 21px;
  }

  .security-footer {
    bottom: 14px;
    max-width: calc(100vw - 28px);
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  input, #loginButton { transition: none; }
}


@media (max-height: 650px) {
  .language-menu {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}
