/* Auth / marketing shell — light agri-tech system (login, signup, forgot, reset) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700&display=swap');

:root {
  --auth-primary: #1f6b45;
  --auth-primary-hover: #185437;
  --auth-accent: #c89b3c;
  --auth-bg: #f7f5ef;
  --auth-surface: #ffffff;
  --auth-text: #1f2937;
  --auth-muted: #6b7280;
  --auth-border: #d9e2d8;
  --auth-danger: #c23b3b;
  --auth-success: #2e7d32;
  --auth-hero-overlay: rgba(15, 40, 28, 0.82);
  --auth-radius-card: 16px;
  --auth-radius-control: 12px;
  --auth-shadow-card: 0 8px 24px rgba(16, 24, 40, 0.08);
  --auth-space-1: 8px;
  --auth-space-2: 16px;
  --auth-space-3: 24px;
  --auth-space-4: 32px;
  --auth-space-5: 40px;
  --auth-space-6: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-shell {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--auth-text);
  background: var(--auth-bg);
  display: block;
  -webkit-font-smoothing: antialiased;
}

body.auth-shell a {
  color: var(--auth-primary);
  text-decoration: none;
}
body.auth-shell a:hover {
  text-decoration: underline;
  color: var(--auth-primary-hover);
}

.auth-split {
  display: flex;
  min-height: 100vh;
}

.auth-hero {
  display: none;
  flex: 1 1 46%;
  max-width: 52%;
  position: relative;
  background-color: #143d2a;
  background-image:
    linear-gradient(135deg, rgba(31, 107, 69, 0.35) 0%, transparent 50%),
    linear-gradient(
      165deg,
      #1a4d32 0%,
      #0d2818 45%,
      #1f6b45 100%
    );
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: var(--auth-space-6);
  flex-direction: column;
  justify-content: flex-end;
}

@media (min-width: 900px) {
  .auth-hero {
    display: flex;
  }
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(200, 155, 60, 0.12), transparent 55%),
    linear-gradient(to top, var(--auth-hero-overlay), transparent 45%);
  pointer-events: none;
}

.auth-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-hero-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--auth-space-2);
}

.auth-hero h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--auth-space-3);
  letter-spacing: -0.02em;
}

.auth-hero p.lead {
  margin: 0 0 var(--auth-space-4);
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.auth-hero ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-hero li {
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--auth-space-2);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
}

.auth-hero li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.25);
}

.auth-panel {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--auth-space-4) var(--auth-space-3);
}

@media (min-width: 900px) {
  .auth-panel {
    flex: 1 1 54%;
    padding: var(--auth-space-6);
  }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-card);
  box-shadow: var(--auth-shadow-card);
  padding: var(--auth-space-5) var(--auth-space-4);
}

@media (min-width: 480px) {
  .auth-card {
    padding: var(--auth-space-6) var(--auth-space-5);
  }
}

.auth-logo {
  margin-bottom: var(--auth-space-3);
}

.auth-logo-mark {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--auth-text);
  letter-spacing: -0.03em;
}

.auth-logo-mark span {
  color: var(--auth-primary);
}

.auth-logo-erp {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--auth-muted);
  margin-top: 4px;
}

.auth-tagline {
  font-size: 13px;
  color: var(--auth-muted);
  line-height: 1.45;
  margin: 0 0 var(--auth-space-4);
  max-width: 360px;
}

.auth-card h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 var(--auth-space-1);
  letter-spacing: -0.02em;
  color: var(--auth-text);
}

.auth-card .auth-subtitle {
  margin: 0 0 var(--auth-space-4);
  color: var(--auth-muted);
  font-size: 15px;
}

.auth-form .field {
  margin-bottom: var(--auth-space-3);
}

.auth-form label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: var(--auth-space-1);
}

.field-label-optional {
  font-weight: 400;
  color: var(--auth-muted);
}

/* One visual system for all text-like controls (matches Work email / email fields). */
.auth-form input:not([type='checkbox']):not([type='hidden']):not([type='radio']),
.auth-form select {
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-control);
  font-size: 15px;
  line-height: 1.25;
  font-family: inherit;
  color: var(--auth-text);
  background-color: var(--auth-surface);
  background-clip: padding-box;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--auth-muted) 50%),
    linear-gradient(135deg, var(--auth-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.auth-form input::placeholder,
.auth-form textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.auth-form input:hover:not(:disabled),
.auth-form select:hover:not(:disabled) {
  border-color: #b8c4b6;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(31, 107, 69, 0.2);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 52px;
}

.auth-toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
}

.auth-toggle-password:hover {
  color: var(--auth-text);
  background: var(--auth-bg);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--auth-space-2);
  margin-bottom: var(--auth-space-3);
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--auth-text);
  cursor: pointer;
}

.auth-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--auth-primary);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--auth-space-3);
  border: none;
  border-radius: var(--auth-radius-control);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.auth-btn:active {
  transform: scale(0.99);
}

.auth-btn-primary {
  background: var(--auth-primary);
  color: #fff;
}

.auth-btn-primary:hover {
  background: var(--auth-primary-hover);
}

.auth-btn-secondary {
  background: transparent;
  color: var(--auth-primary);
  border: 1px solid var(--auth-border);
  margin-top: var(--auth-space-2);
}

.auth-btn-secondary:hover {
  background: var(--auth-bg);
  border-color: #c5d1c3;
}

.auth-links {
  margin-top: var(--auth-space-3);
  text-align: center;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-links a {
  font-weight: 500;
}

.auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--auth-space-2) var(--auth-space-3);
  margin-top: var(--auth-space-4);
  padding-top: var(--auth-space-3);
  border-top: 1px solid var(--auth-border);
}

.auth-trust span {
  font-size: 12px;
  color: var(--auth-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-trust span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-success);
  flex-shrink: 0;
}

.auth-flash {
  padding: 12px 14px;
  border-radius: var(--auth-radius-control);
  font-size: 14px;
  margin-bottom: var(--auth-space-3);
}

.auth-flash-error {
  background: #fdf2f2;
  border: 1px solid #f5c4c4;
  color: #9b2c2c;
}

.auth-flash-ok {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}

.auth-flash-warn {
  background: #fff8e6;
  border: 1px solid #e6d4a8;
  color: #6d5a1a;
}

.auth-callout {
  font-size: 13px;
  color: var(--auth-muted);
  line-height: 1.5;
  margin: 0 0 var(--auth-space-3);
}

.auth-callout--admin {
  background: var(--auth-bg);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-control);
  padding: var(--auth-space-2);
  margin-bottom: var(--auth-space-3);
}

.auth-callout--admin code,
.auth-callout--admin pre {
  font-size: 12px;
  word-break: break-word;
}

.auth-callout--admin pre {
  margin: var(--auth-space-1) 0 0;
  overflow: auto;
  white-space: pre-wrap;
}

.auth-success-panel {
  text-align: center;
  padding: var(--auth-space-2) 0;
}

.auth-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--auth-space-3);
  border-radius: 50%;
  background: #e8f5e9;
  color: var(--auth-success);
  font-size: 28px;
  line-height: 56px;
  font-weight: 700;
}

/* Stepper */
.auth-stepper {
  display: flex;
  align-items: center;
  gap: var(--auth-space-1);
  margin-bottom: var(--auth-space-4);
}

.auth-step-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--auth-border);
  transition: background 0.2s;
}

.auth-step-dot.is-active {
  background: var(--auth-primary);
}

.auth-step-dot.is-done {
  background: var(--auth-accent);
}

.auth-step {
  display: none;
}

.auth-step.is-active {
  display: block;
}

.auth-step-actions {
  display: flex;
  flex-direction: column;
  gap: var(--auth-space-2);
  margin-top: var(--auth-space-4);
}

@media (min-width: 400px) {
  .auth-step-actions.row {
    flex-direction: row;
    justify-content: space-between;
  }
  .auth-step-actions.row .auth-btn {
    width: auto;
    min-width: 120px;
  }
  .auth-step-actions.row .auth-btn-secondary {
    margin-top: 0;
  }
}

.auth-footer {
  text-align: center;
  padding: var(--auth-space-3);
  font-size: 13px;
  color: var(--auth-muted);
}

.auth-mobile-hero {
  background: linear-gradient(135deg, #1f6b45, #143d2a);
  color: #fff;
  padding: var(--auth-space-3) var(--auth-space-3);
  margin: calc(-1 * var(--auth-space-4)) calc(-1 * var(--auth-space-3)) var(--auth-space-4);
  border-radius: 0 0 var(--auth-radius-card) var(--auth-radius-card);
}

@media (min-width: 900px) {
  .auth-mobile-hero {
    display: none;
  }
}

.auth-mobile-hero h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  margin: 0 0 8px;
}

.auth-mobile-hero p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.45;
}

.auth-enterprise {
  margin: var(--auth-space-3) 0 0;
  padding: var(--auth-space-3);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-control);
  background: var(--auth-surface);
}

.auth-enterprise-title {
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  margin: 0 0 var(--auth-space-1);
  color: var(--auth-text);
}

.auth-enterprise-desc {
  margin: 0 0 var(--auth-space-2);
  font-size: 13px;
  color: var(--auth-muted);
  line-height: 1.45;
}

.enterprise-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  cursor: pointer;
}

.enterprise-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.auth-enterprise-msg {
  margin: var(--auth-space-2) 0 0;
  font-size: 13px;
  color: var(--auth-danger);
}
