/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f7f5;
  color: #111111;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   NAV
   =========================== */
.auth-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
}

.auth-nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.auth-nav-back {
  font-size: 13px;
  color: #888888;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-nav-back:hover { color: #111111; }

/* ===========================
   AUTH SHELL (two-panel layout)
   =========================== */
.auth-shell {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  padding-top: 56px;
}

/* ===========================
   AUTH CARD
   =========================== */
.auth-card {
  flex: 0 0 auto;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  position: relative;
  overflow: hidden;
}

/* ===========================
   AUTH STEPS
   =========================== */
.auth-step {
  position: absolute;
  inset: 0;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-step.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
  position: relative;
  inset: auto;
}

.auth-step.exit {
  opacity: 0;
  transform: translateX(-24px);
  position: absolute;
  inset: 0;
}

/* ===========================
   AUTH HEADER
   =========================== */
.auth-header {
  margin-bottom: 32px;
}

.auth-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #888888;
  margin-bottom: 12px;
}

.success-eyebrow { color: #2d7a3e; }

.auth-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #111111;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
}

.auth-subtitle strong { color: #111111; }

/* ===========================
   BACK BUTTON
   =========================== */
.back-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #888888;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.15s;
  display: block;
}

.back-btn:hover { color: #111111; }

/* ===========================
   ROLE SELECTOR
   =========================== */
.role-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px 22px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.role-card:hover {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17,17,17,0.06);
}

.role-card.selected {
  border-color: #111111;
  background: #fafafa;
}

.role-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.role-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.role-name {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  line-height: 1.3;
}

.role-desc {
  font-size: 12px;
  color: #888888;
  line-height: 1.45;
}

.role-arrow {
  font-size: 16px;
  color: #cccccc;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.role-card:hover .role-arrow,
.role-card.selected .role-arrow {
  color: #111111;
  transform: translateX(3px);
}

/* ===========================
   ROLE BADGE (step 2)
   =========================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #555555;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 16px;
}

/* ===========================
   SOCIAL BUTTONS
   =========================== */
.social-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #111111;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.social-btn:hover {
  background: #f7f7f5;
  border-color: #999999;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

/* ===========================
   DIVIDER
   =========================== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: #bbbbbb;
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}

/* ===========================
   FORM FIELDS
   =========================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: #333333;
}

.optional-tag {
  font-size: 11px;
  font-weight: 400;
  color: #aaaaaa;
  margin-left: 4px;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  font-size: 15px;
  color: #111111;
  background: #ffffff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input::placeholder { color: #bbbbbb; }

.field-input:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

.field-input.error {
  border-color: #d93025;
  box-shadow: 0 0 0 3px rgba(217,48,37,0.1);
}

.field-hint {
  font-size: 12px;
  color: #999999;
  line-height: 1.5;
}

/* Input wrapper (for show/hide password) */
.input-wrapper {
  position: relative;
}

.input-wrapper .field-input {
  padding-right: 56px;
}

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: #888888;
  cursor: pointer;
  font-family: inherit;
  padding: 4px;
  transition: color 0.15s;
}

.toggle-pw:hover { color: #111111; }

/* Password strength */
.pw-strength {
  height: 3px;
  background: #ededed;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.pw-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

/* ===========================
   PRIMARY BUTTON
   =========================== */
.btn-primary-full {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #111111;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
  text-align: center;
  text-decoration: none;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.btn-primary-full:hover { background: #333333; }
.btn-primary-full:active { transform: scale(0.99); }

/* ===========================
   LINK BUTTON
   =========================== */
.link-btn {
  background: none;
  border: none;
  font-size: inherit;
  font-family: inherit;
  color: #111111;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.15s;
}

.link-btn:hover { color: #555555; }

/* ===========================
   OTP
   =========================== */
.otp-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.otp-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.otp-box {
  flex: 1;
  min-width: 0;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  font-family: inherit;
  color: #111111;
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: transparent;
}

.otp-box:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

.otp-box.filled {
  border-color: #555555;
  background: #fafafa;
}

.otp-box.error-box {
  border-color: #d93025;
  box-shadow: 0 0 0 3px rgba(217,48,37,0.1);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.otp-error {
  font-size: 13px;
  color: #d93025;
  margin-bottom: 12px;
}

.otp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: #888888;
}

.otp-timer strong { color: #555555; }

/* ===========================
   SIGN UP FORM
   =========================== */
.form-stack { display: flex; flex-direction: column; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #555555;
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 20px;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: #111111;
  cursor: pointer;
}

.inline-link {
  color: #111111;
  text-underline-offset: 2px;
  font-weight: 500;
}

/* ===========================
   FORGOT PASSWORD ROW
   =========================== */
.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  margin-top: -8px;
}

/* ===========================
   SUCCESS SCREEN
   =========================== */
.success-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-shell .auth-title { margin-bottom: 8px; }

.success-loader {
  width: 160px;
  height: 3px;
  background: #e8e8e8;
  border-radius: 2px;
  overflow: hidden;
  margin: 28px auto 24px;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: #111111;
  border-radius: 2px;
  animation: loadProgress 2s ease forwards;
}

@keyframes loadProgress {
  0%   { width: 0%; }
  100% { width: 100%; }
}

.success-link { max-width: 240px; margin: 0 auto; }

/* ===========================
   ASIDE PANEL
   =========================== */
.auth-aside {
  flex: 1;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 56px;
}

.aside-content { max-width: 380px; }

.aside-quote {
  font-size: 18px;
  font-weight: 400;
  color: #dddddd;
  line-height: 1.65;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  font-style: italic;
  border: none;
}

.aside-attribution {
  font-size: 13px;
  color: #666666;
  margin-bottom: 48px;
}

.aside-stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-top: 1px solid #222222;
  padding-top: 32px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-num {
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 12px;
  color: #555555;
  letter-spacing: 0.02em;
}

/* ===========================
   TOGGLE HINT
   =========================== */
.auth-toggle-hint {
  font-size: 13px;
  color: #888888;
  margin-top: auto;
  padding-top: 16px;
}

/* ===========================
   UTILITY
   =========================== */
.hidden { display: none !important; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 740px) {
  .auth-aside { display: none; }

  .auth-card {
    border-right: none;
    max-width: 100%;
  }

  .auth-step {
    padding: 32px 24px;
  }

  .otp-grid { gap: 7px; }
  .otp-box { height: 48px; font-size: 18px; }

  .form-row {
    grid-template-columns: 1fr;
  }
}
