/* ═══════════════════════════════════════════════════════════
   Valle Vivo – Login / Sign-up Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --forest: #2d4a38;
  --forest-light: #3a5c47;
  --clay: #c06e3a;
  --clay-lt: #f0ddc8;
  --cream: #f7f3eb;
  --parchment: #ebe2d3;
  --stone: #6e6a63;
  --charcoal: #2a2520;
  --white: #ffffff;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.25, .46, .45, .94);
  --dur: 240ms;
  --radius: 12px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left image panel ── */
.panel-image {
  position: relative;
  overflow: hidden;
  height: 100vh;
}

.panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 40, 30, .3) 0%, rgba(26, 40, 30, .6) 100%);
}

.panel-image-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  color: var(--white);
}

.panel-logo {
  position: absolute;
  top: 36px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
}

.panel-logo-mark {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.panel-quote {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
}

.panel-quote em {
  font-style: italic;
  color: var(--clay-lt);
}

.panel-caption {
  font-size: .85rem;
  font-weight: 300;
  opacity: .75;
  letter-spacing: .04em;
}

/* ── Right form panel ── */
.panel-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 48px;
  height: 100vh;
  overflow-y: auto;
  background: var(--white);
  position: relative;
}

/* ── Auth loading overlay ── */
.panel-loading {
  position: absolute;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
}

.panel-loading .spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid var(--parchment);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.panel-loading p {
  font-size: .85rem;
  color: var(--stone);
}

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

/* ── Form box ── */
.form-box {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 32px 0;
  animation: fadeUp .5s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Sign in / Create account tabs ── */
.auth-tabs {
  display: flex;
  background: var(--cream);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: .85rem;
  font-weight: 500;
  color: var(--stone);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  background: none;
  font-family: var(--font-body);
}

.auth-tab.active {
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 2px 8px rgba(42, 37, 32, .1);
}

/* ── Form headings ── */
.form-heading {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.1;
}

.form-subheading {
  font-size: .875rem;
  color: var(--stone);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Form fields ── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 7px;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  transition: border-color var(--dur), background var(--dur);
  appearance: none;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--clay);
  background: var(--white);
}

.field input.error {
  border-color: #c0392b;
}

.field-error {
  font-size: .75rem;
  color: #c0392b;
  margin-top: 5px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── Role picker ── */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.role-option {
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius);
  padding: 10px 8px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: center;
  background: var(--cream);
}

.role-option:hover {
  border-color: var(--stone);
}

.role-option.selected {
  border-color: var(--clay);
  background: rgba(192, 110, 58, .06);
}

.role-option input {
  display: none;
}

.role-icon {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.role-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--charcoal);
}

.role-desc {
  font-size: .68rem;
  color: var(--stone);
  margin-top: 1px;
}

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--forest);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--dur) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: .75rem;
  color: var(--stone);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--parchment);
}

/* ── Google button ── */
.btn-google {
  width: 100%;
  padding: 12px;
  background: var(--white);
  color: var(--charcoal);
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--dur) var(--ease);
}

.btn-google:hover {
  border-color: var(--stone);
  background: var(--cream);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

/* ── Alert banner ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 20px;
  display: none;
}

.alert.visible {
  display: block;
}

.alert.error {
  background: #fdf0ef;
  border: 1px solid #f5c6c2;
  color: #c0392b;
}

.alert.success {
  background: #edf7f0;
  border: 1px solid #b8dfc4;
  color: #2e7d32;
}

/* ── Form footer text ── */
.form-footer {
  text-align: center;
  font-size: .78rem;
  color: var(--stone);
  margin-top: 28px;
  line-height: 1.6;
}

.form-footer a {
  color: var(--clay);
  text-decoration: underline;
}

/* ── Button loading spinner ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.spinner.visible {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .panel-image {
    display: none;
  }

  .panel-form {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    padding: 40px 24px;
  }
}
