@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg-cream: #f5f3ee;
  --bg-panel: #1e2d24;
  --primary: #4a7c59;
  --accent: #3d7a5c;
  --light: #6a9e78;
  --surface: #e8f0eb;
  
  --amber: #d97706;
  --amber-pale: #fef7e6;
  
  --text-main: #1e2d24;
  --text-sec: #5a7a65;
  --text-muted: #8fa89a;
  
  --border: #dde5df;
  --border-focus: #4a7c59;
  --border-filled: #c8d8cc;
  
  --error: #c0392b;
  --error-bg: #fdf3f2;
  --success: #2d7a4f;
  --success-bg: #f4fbf6;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Outfit', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-cream);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── LAYOUT PRINCIPAL ── */
.auth-wrapper {
  width: 100%;
  max-width: 1000px;
  min-height: 640px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  box-shadow: 0 32px 80px -20px rgba(30, 45, 36, 0.15), 0 8px 24px -4px rgba(0, 0, 0, 0.04);
  display: flex;
  overflow: hidden;
}

/* ── PANEL IZQUIERDO (40%) ── */
.auth-left {
  width: 40%;
  background-color: var(--bg-panel);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  color: #fff;
}

/* Formas decorativas sutiles */
.auth-left::before,
.auth-left::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-left::before {
  width: 400px;
  height: 400px;
  top: -150px;
  right: -150px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
}

.auth-left::after {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -100px;
  background: radial-gradient(circle, rgba(106, 158, 120, 0.15) 0%, transparent 70%);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: auto;
  position: relative;
  z-index: 2;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--amber));
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-role {
  font-size: 10px;
  text-transform: uppercase;
  background-color: rgba(255,255,255,0.1);
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  color: var(--surface);
}

.left-headline {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 60px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.left-headline em {
  color: var(--amber);
  font-style: italic;
}

.left-subtext {
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 90%;
  position: relative;
  z-index: 2;
}

.left-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.bullet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.bullet-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(106, 158, 120, 0.15);
  display: grid;
  place-items: center;
  color: var(--light);
}

.bullet-check svg {
  width: 12px;
  height: 12px;
}

/* ── PANEL DERECHO (60%) ── */
.auth-right {
  width: 60%;
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.top-bar {
  position: absolute;
  top: 40px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-sec);
}

.section-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-tag::before {
  content: "";
  width: 16px;
  height: 1px;
  background-color: var(--primary);
}

.form-header {
  margin-top: 30px;
  margin-bottom: 32px;
}

.form-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-title em {
  font-style: italic;
  color: var(--primary);
}

.form-subtitle {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
}

/* ── ROLE TABS ── */
.role-tabs {
  display: flex;
  justify-content: center;
  background-color: var(--surface);
  border-radius: 20px;
  padding: 4px;
  margin-bottom: 24px;
  max-width: 400px;
}

.role-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.role-tab:hover {
  color: var(--amber);
}

.role-tab.active {
  background: linear-gradient(135deg, var(--amber), #f59e0b);
  color: #fff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

/* ── FORM COMPONENTS ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 400px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
}

.field-link {
  font-size: 11px;
  color: var(--amber);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.field-link:hover {
  color: #f59e0b;
  text-decoration: underline;
}

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

.field-input {
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.field-input::placeholder {
  color: #a8b9b0;
  font-weight: 400;
}

.field-input:focus {
  border-color: var(--border-focus);
}

.field-input:not(:placeholder-shown) {
  border-color: var(--border-filled);
}

/* Error States */
.field-input.has-error {
  border-color: var(--error);
  background-color: var(--error-bg);
}

.field-label.has-error {
  color: var(--error);
}

.field-message {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.field-message.error {
  color: var(--error);
}

.field-message.success {
  color: var(--success);
}

/* Password Toggle */
.pw-toggle {
  position: absolute;
  right: 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--amber);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.pw-toggle:hover {
  color: #f59e0b;
  text-decoration: underline;
}

/* ── SPECIFICS ── */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-label {
  font-size: 12px;
  color: var(--text-sec);
  cursor: pointer;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 10px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider::before { margin-right: 12px; }
.auth-divider::after { margin-left: 12px; }

.btn-primary {
  height: 46px;
  background: linear-gradient(135deg, var(--primary), var(--light));
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--amber), #f59e0b);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
  transform: translateY(-1px);
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--amber);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.form-footer a:hover {
  color: #f59e0b;
  text-decoration: underline;
}

/* ── STRENGTH INDICATOR ── */
.strength-container {
  margin-top: 8px;
}

.strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.strength-segment {
  flex: 1;
  height: 3px;
  background-color: var(--border);
  border-radius: 2px;
  transition: background-color 0.3s;
}

.strength-label {
  font-size: 11px;
  font-weight: 500;
}

/* Levels */
.strength-container[data-score="1"] .segment-1 { background-color: var(--error); }
.strength-container[data-score="1"] .strength-label { color: var(--error); }

.strength-container[data-score="2"] .segment-1,
.strength-container[data-score="2"] .segment-2 { background-color: #f59e0b; }
.strength-container[data-score="2"] .strength-label { color: #f59e0b; }

.strength-container[data-score="3"] .segment-1,
.strength-container[data-score="3"] .segment-2,
.strength-container[data-score="3"] .segment-3 { background-color: var(--light); }
.strength-container[data-score="3"] .strength-label { color: var(--light); }

.strength-container[data-score="4"] .strength-segment { background-color: var(--success); }
.strength-container[data-score="4"] .strength-label { color: var(--success); }

/* Hints */
.hints-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hint-item {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.hint-item.met {
  color: var(--success);
}

.hint-item svg {
  width: 12px;
  height: 12px;
}

/* Flash message overrides */
.auth-flash {
  font-size: 12px;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-flash.error {
  background-color: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(192, 57, 43, 0.2);
}
.auth-flash.success {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(45, 122, 79, 0.2);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
    min-height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }

  body {
    padding: 0;
  }

  .auth-left {
    width: 100%;
    padding: 24px;
    height: 80px;
    flex-direction: row;
    align-items: center;
  }
  
  .auth-left::before, .auth-left::after {
    display: none;
  }

  .brand-badge {
    margin: 0;
  }

  .left-headline, .left-subtext, .left-bullets {
    display: none;
  }

  .auth-right {
    width: 100%;
    flex: 1;
    padding: 32px 24px;
  }

  .top-bar {
    position: static;
    margin-bottom: 24px;
  }

  .form-header {
    margin-top: 0;
  }

  .auth-form {
    max-width: 100%;
  }
}
