
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep:        #0d2b1a;
  --bg-panel-1:     #0f3322;
  --bg-panel-2:     #133d29;
  --green-primary:  #1b6b3a;
  --green-primary-hover: #155230;
  --green-accent:   #3ddc84;
  --green-pale:     rgba(61, 220, 132, 0.12);
  --green-faint:    rgba(61, 220, 132, 0.06);

  --surface:        #ffffff;
  --surface-alt:    #f6faf7;

  --text-heading:   #10241a;
  --text-body:      #3a4f45;
  --text-muted:     #6b8478;
  --text-faint:     #9db3a8;

  --input-bg:       #f6faf7;
  --input-border:   #dbe8e0;
  --input-focus:    #1b6b3a;

  --error-red:      #c62828;

  --radius-card:    20px;
  --radius-input:   10px;
  --radius-btn:     10px;

  --shadow-card:    0 24px 64px rgba(13, 43, 26, 0.14), 0 4px 16px rgba(13, 43, 26, 0.06);

  --font-display:   'Space Grotesk', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--surface-alt);
  min-height: 100vh;
  color: var(--text-body);
}

.auth-layout {
  display: flex;
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  flex: 0 1 44%;
  min-width: 420px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 16, 10, 0.88) 0%, rgba(5, 16, 10, 0.18) 24%, rgba(5, 16, 10, 0.14) 58%, rgba(5, 16, 10, 0.48) 80%, rgba(5, 16, 10, 0.94) 100%),
    linear-gradient(100deg, rgba(5, 16, 10, 0.8) 0%, rgba(5, 16, 10, 0.6) 32%, rgba(5, 16, 10, 0.2) 60%, rgba(5, 16, 10, 0) 80%),
    url('../assets/mangrove bg.jpg') 68% center / cover no-repeat;
  background-blend-mode: normal, multiply, normal;
  display: flex;
  flex-direction: column;
}

#gisCanvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.brand-panel-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 48px 32px;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-seal {
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--green-accent);
  margin-top: 3px;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.brand-mid {
  max-width: 380px;
}

.brand-headline {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.brand-copy {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  margin-bottom: 32px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.brand-coords {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: rgba(5, 16, 10, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  width: fit-content;
}

.brand-coord {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-coord-value {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-accent);
  letter-spacing: 0.02em;
}

.brand-coord-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.brand-coord-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
}

.brand-footer {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.03em;
  font-weight: 500;
}

.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    radial-gradient(560px 460px at 50% 42%, rgba(61, 220, 132, 0.14) 0%, rgba(61, 220, 132, 0) 70%),
    repeating-linear-gradient(0deg, rgba(27, 107, 58, 0.05) 0px, rgba(27, 107, 58, 0.05) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(27, 107, 58, 0.05) 0px, rgba(27, 107, 58, 0.05) 1px, transparent 1px, transparent 44px),
    var(--surface-alt);
}

.form-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px 36px 32px;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-card-head {
  margin-bottom: 26px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-body);
  letter-spacing: 0.01em;
}

.field-group input[type="text"],
.field-group input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-heading);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field-group input::placeholder {
  color: var(--text-faint);
}

.field-group input:focus {
  border-color: var(--input-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.10);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 42px;
}

.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.toggle-pw:hover {
  color: var(--green-primary);
}

.btn-signin {
  width: 100%;
  padding: 13px 16px;
  background: var(--green-primary);
  border: none;
  border-radius: var(--radius-btn);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  margin-top: 2px;
}

.btn-arrow {
  transition: transform 0.2s;
  font-size: 1rem;
}

.btn-signin:hover {
  background: var(--green-primary-hover);
  box-shadow: 0 6px 20px rgba(27, 107, 58, 0.24);
}

.btn-signin:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-signin:active {
  transform: scale(0.98);
}

.btn-signin:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.error-msg {
  font-size: 0.78rem;
  color: var(--error-red);
  min-height: 16px;
  text-align: center;
}

.form-row-end {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.forgot-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-primary);
  cursor: pointer;
  transition: color 0.16s ease;
}

.forgot-link:hover {
  color: var(--green-primary-hover);
  text-decoration: underline;
}

.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 43, 26, 0.55);
  backdrop-filter: blur(3px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-overlay.open {
  display: flex;
}

.auth-modal {
  position: relative;
  width: min(380px, 92vw);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px 28px 28px;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.auth-modal-close:hover {
  background: var(--surface-alt);
  color: var(--text-body);
}

.auth-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.auth-modal-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .auth-layout {
    flex-direction: column;
  }

  .brand-panel {
    flex: none;
    min-width: 0;
    min-height: 260px;
  }

  .brand-panel-content {
    padding: 32px 28px 24px;
  }

  .brand-headline {
    font-size: 1.5rem;
  }

  .brand-copy {
    margin-bottom: 20px;
  }

  .form-panel {
    padding: 28px 20px 40px;
  }
}

@media (max-width: 480px) {
  .form-card {
    padding: 30px 22px 26px;
  }

  .brand-coords {
    gap: 14px;
    padding: 12px 16px;
  }
}
