:root {
  --gov-blue: #1a5c96;
  --gov-blue-dark: #124470;
  --gov-red: #d21f2c;
  --gov-red-dark: #a8161f;
  --text-main: #2b2f33;
  --text-muted: #8a8f96;
  --bg-page: #f2f4f6;
  --bg-card: #ffffff;
  --border: #dfe3e7;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.view[hidden] {
  display: none;
}

/* Header */
.gov-header {
  background: linear-gradient(135deg, var(--gov-blue) 0%, var(--gov-blue-dark) 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gov-header .logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.gov-header .title-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.gov-header .title-block .main {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gov-header .title-block .sub {
  font-size: 12px;
  opacity: 0.85;
}

.gov-header .spacer {
  flex: 1;
}

.gov-header .logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

.gov-header .logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Red accent bar, like the site's nav */
.gov-accent-bar {
  background: var(--gov-red);
  height: 6px;
  width: 100%;
}

/* Login view */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(20, 40, 60, 0.12);
  width: 100%;
  max-width: 360px;
  padding: 28px 26px 30px;
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--gov-blue-dark);
}

.login-card p.hint {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field .req {
  color: var(--gov-red);
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gov-blue);
  box-shadow: 0 0 0 3px rgba(26, 92, 150, 0.12);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--gov-red);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--gov-red-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-outline {
  background: transparent;
  border: 1px dashed var(--gov-blue);
  color: var(--gov-blue);
}

.btn-outline:hover {
  background: rgba(26, 92, 150, 0.06);
}

.login-error {
  color: var(--gov-red);
  font-size: 13px;
  margin: -4px 0 14px;
  min-height: 16px;
}

/* Form view */
.form-wrap {
  flex: 1;
  padding: 18px 16px 40px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.form-wrap h1 {
  font-size: 18px;
  color: var(--gov-blue-dark);
  margin: 4px 0 18px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(20, 40, 60, 0.08);
  padding: 20px;
}

.field-row-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.field-row-label .detail-link {
  color: var(--gov-blue);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap input {
  padding-right: 34px;
}

.input-icon-wrap .icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
}

.select-fake {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-fake .icon-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-page);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.coords-box {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: none;
}

.coords-box.visible {
  display: block;
}

.coords-box.pending {
  color: var(--gov-blue);
}

.coords-box.error {
  color: var(--gov-red);
}

.geo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.geo-modal-backdrop[hidden] {
  display: none;
}

.geo-modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.geo-modal .geo-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.geo-modal h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--gov-blue-dark);
}

.geo-modal p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.geo-modal .geo-actions {
  display: flex;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gov-blue-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

footer.gov-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 14px;
}
