/**
 * AgroFarm Auth Stylesheet (Shared by Login and Register)
 * Estética: Minimalismo premium agronegócio, verde-floresta (#102E26), fundo creme (#F4F1E7).
 */

@import url('./agrofarm-tokens.css');

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Layout Principal Dividido */
.auth-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

@media (min-width: 900px) {
  .auth-wrapper {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }
}

/* =========================================
   LADO FOTOGRÁFICO DO AGRO (52% Desktop)
   ========================================= */
.auth-hero {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: var(--forest-950);
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 600px) and (max-width: 899px) {
  .auth-hero {
    height: 230px;
  }
}

@media (min-width: 900px) {
  .auth-hero {
    width: 52%;
    height: 100vh;
  }
}

.auth-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.03);
  transition: transform 600ms ease-out;
}

.auth-hero:hover .auth-hero-img {
  transform: scale(1);
}

.auth-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(16, 46, 38, 0.92) 0%, rgba(23, 63, 53, 0.75) 60%, rgba(16, 46, 38, 0.4) 100%);
  mix-blend-mode: multiply;
}

@media (min-width: 900px) {
  .auth-hero-overlay {
    background: linear-gradient(to right, rgba(16, 46, 38, 0.92) 0%, rgba(23, 63, 53, 0.78) 60%, rgba(16, 46, 38, 0.45) 100%);
  }
}

.auth-hero-svg-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
  stroke: var(--field-500);
}

.auth-hero-content {
  display: none;
  position: relative;
  z-index: 10;
  height: 100%;
  padding: 48px;
  flex-direction: column;
  justify-content: space-between;
  color: var(--warm-white);
}

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

@media (min-width: 1200px) {
  .auth-hero-content {
    padding: 64px;
  }
}

.auth-badge-smart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(115, 169, 66, 0.2);
  border: 1px solid rgba(115, 169, 66, 0.35);
  color: var(--field-300);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  width: fit-content;
}

.auth-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--warm-white);
  margin-bottom: 12px;
}

.auth-hero-title span {
  color: var(--field-300);
  display: block;
}

.auth-hero-desc {
  font-size: 15px;
  color: rgba(244, 241, 231, 0.85);
  line-height: 1.6;
  max-width: 480px;
}

.auth-hero-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: rgba(244, 241, 231, 0.7);
}

.auth-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  z-index: 10;
}

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

/* =========================================
   LADO DO FORMULÁRIO (48% Desktop)
   ========================================= */
.auth-form-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  flex: 1;
  background-color: var(--cream);
  position: relative;
  z-index: 20;
  margin-top: -26px;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -8px 24px rgba(16, 46, 38, 0.08);
  min-height: calc(100vh - 174px);
}

@media (min-width: 900px) {
  .auth-form-container {
    width: 48%;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    height: 100vh;
    overflow-y: auto;
  }
}

.auth-form-column {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

@media (min-width: 600px) {
  .auth-form-column {
    padding: 40px 32px;
  }
}

.auth-desktop-logo {
  display: none;
  margin-bottom: 24px;
}

@media (min-width: 900px) {
  .auth-desktop-logo {
    display: block;
  }
}

/* Tipografia de Cabeçalho do Formulário */
.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--forest-700);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--forest-950);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Grupos de Formulário e Inputs */
.auth-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}

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

.auth-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--forest-950);
}

.auth-link-forgot {
  font-size: 11px;
  font-weight: 600;
  color: var(--forest-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-link-forgot:hover {
  color: var(--forest-950);
  text-decoration: underline;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border-radius: var(--radius-lg);
  background-color: var(--warm-white);
  border: 1px solid rgba(16, 46, 38, 0.15);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--forest-950);
  transition: all var(--transition-fast);
  outline: none;
}

.auth-input:focus {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 3px rgba(115, 169, 66, 0.22);
}

.auth-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(196, 81, 69, 0.18);
}

.auth-input:disabled {
  background-color: rgba(244, 241, 231, 0.5);
  cursor: not-allowed;
  opacity: 0.75;
}

.auth-btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.auth-btn-toggle-pass:hover {
  color: var(--forest-950);
}

/* Inline Feedback */
.auth-field-error {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-field-hint {
  font-size: 10px;
  color: var(--muted);
}

.auth-field-success-hint {
  font-size: 10px;
  font-weight: 700;
  color: var(--positive);
}

/* Alerta Geral */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-alert-danger {
  background-color: rgba(196, 81, 69, 0.1);
  border: 1px solid rgba(196, 81, 69, 0.25);
  color: var(--danger);
}

.auth-alert-success {
  background-color: rgba(33, 136, 90, 0.1);
  border: 1px solid rgba(33, 136, 90, 0.25);
  color: var(--positive);
}

/* Botões */
.auth-btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background-color: var(--forest-900);
  border: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--warm-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(23, 63, 53, 0.25);
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.auth-btn-primary:hover:not(:disabled) {
  background-color: var(--forest-950);
  box-shadow: 0 6px 16px rgba(16, 46, 38, 0.3);
  transform: translateY(-1px);
}

.auth-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-btn-primary.is-success {
  background-color: var(--positive);
  box-shadow: 0 4px 12px rgba(33, 136, 90, 0.3);
}

/* Divisor */
.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 12px;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background-color: rgba(16, 46, 38, 0.1);
}

.auth-divider span {
  position: relative;
  background-color: var(--cream);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

/* Botão Secundário */
.auth-btn-secondary {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background-color: var(--warm-white);
  border: 1px solid rgba(16, 46, 38, 0.15);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--forest-950);
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.auth-btn-secondary:hover {
  background-color: rgba(234, 229, 213, 0.6);
  border-color: rgba(47, 111, 78, 0.4);
}

/* Rodapé */
.auth-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(16, 46, 38, 0.08);
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  background-color: var(--cream);
}

/* Spinner */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 254, 250, 0.3);
  border-top-color: var(--field-300);
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
