/* ============================================
   STACKWISE — AUTH PAGE STYLES
   Clean centered auth card, warm neutral palette
   ============================================ */

:root {
  --auth-accent: #5C6B4F;
  --auth-accent-hover: #4A5840;
  --auth-accent-light: #EEF1EB;
  --auth-accent-subtle: rgba(92, 107, 79, 0.08);
  --auth-bg: #F5F0EB;
  --auth-bg-card: #FFFFFF;
  --auth-bg-input: #FFFFFF;
  --auth-text: #1A1915;
  --auth-text-secondary: #6B6560;
  --auth-text-tertiary: #9C9590;
  --auth-text-inverse: #FAF7F4;
  --auth-border: #E0DAD3;
  --auth-border-hover: #CCC5BD;
  --auth-border-focus: #5C6B4F;
  --auth-border-error: #B85C3A;
  --auth-error: #B85C3A;
  --auth-error-bg: #FDF3EE;
  --auth-error-text: #B85C3A;
  --auth-success: #5C6B4F;
  --auth-shadow-xs: 0 1px 2px rgba(26, 25, 21, 0.04);
  --auth-shadow-sm: 0 1px 3px rgba(26, 25, 21, 0.05), 0 1px 2px rgba(26, 25, 21, 0.03);
  --auth-shadow-md: 0 4px 16px rgba(26, 25, 21, 0.06);
  --auth-shadow-focus: 0 0 0 3px rgba(92, 107, 79, 0.18);
  --auth-shadow-error-focus: 0 0 0 3px rgba(184, 92, 58, 0.15);
  --auth-radius: 12px;
  --auth-radius-input: 8px;
  --auth-radius-btn: 8px;
  --auth-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --auth-t-fast: 150ms;
  --auth-t-med: 200ms;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--auth-text);
  background-color: var(--auth-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; border: none; outline: none; }
a      { color: var(--auth-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* PAGE LAYOUT */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 48px 24px;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* LOGO */
.auth-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--auth-text);
  transition: opacity var(--auth-t-fast) var(--auth-ease);
  justify-content: center;
}
.auth-logo:hover { opacity: 0.75; text-decoration: none; }
.auth-logo__text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--auth-text);
}

/* CARD */
.auth-card {
  background: var(--auth-bg-card);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 32px;
  box-shadow: var(--auth-shadow-md);
}

/* TABS */
.auth-tabs {
  display: flex;
  position: relative;
  background: var(--auth-bg);
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--auth-text-secondary);
  border-radius: 5px;
  transition: color var(--auth-t-fast) var(--auth-ease);
  position: relative;
  z-index: 1;
}
.auth-tab--active { color: var(--auth-text); }

.auth-tab__indicator {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--auth-bg-card);
  border-radius: 5px;
  box-shadow: var(--auth-shadow-xs);
  transition: transform var(--auth-t-med) var(--auth-ease);
  z-index: 0;
}
.auth-tabs[data-active="signup"] .auth-tab__indicator {
  transform: translateX(100%);
}

/* HEADINGS */
.auth-heading {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--auth-text);
  margin-bottom: 4px;
}
.auth-subheading {
  font-size: 14px;
  color: var(--auth-text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}

/* PANELS */
.auth-panel { animation: authFadeIn 0.2s var(--auth-ease) both; }
.auth-panel--hidden { display: none; }

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* FORM */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; }
.auth-label { font-size: 13.5px; font-weight: 500; color: var(--auth-text); }
.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--auth-text);
  background: var(--auth-bg-input);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-input);
  transition: border-color var(--auth-t-fast) var(--auth-ease), box-shadow var(--auth-t-fast) var(--auth-ease);
}
.auth-input::placeholder { color: var(--auth-text-tertiary); }
.auth-input:hover { border-color: var(--auth-border-hover); }
.auth-input:focus { border-color: var(--auth-border-focus); box-shadow: var(--auth-shadow-focus); outline: none; }
.auth-input--error, .auth-input--error:hover { border-color: var(--auth-border-error); }
.auth-input--error:focus { border-color: var(--auth-border-error); box-shadow: var(--auth-shadow-error-focus); }
.auth-input-wrap--password .auth-input { padding-right: 46px; }

/* PASSWORD TOGGLE */
.auth-toggle-pw {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--auth-text-tertiary);
  border-radius: 6px;
  transition: color var(--auth-t-fast) var(--auth-ease), background var(--auth-t-fast) var(--auth-ease);
}
.auth-toggle-pw:hover { color: var(--auth-text-secondary); background: var(--auth-accent-subtle); }

/* FIELD ERRORS */
.auth-field-error { font-size: 13px; color: var(--auth-error-text); line-height: 1.4; padding-left: 2px; }

/* ERROR BANNER */
.auth-error-banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; font-size: 13px; line-height: 1.45;
  color: #9d3a3a;
  background: #fff1f1;
  border-radius: var(--auth-radius-input);
  border: 1px solid #f5c6c6;
  animation: authFadeIn 0.2s var(--auth-ease) both;
}
.auth-error-banner[hidden] { display: none !important; }
.auth-error-banner svg { flex-shrink: 0; margin-top: 1px; color: #c55050; }

/* BUTTONS */
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 42px; padding: 0 20px;
  font-size: 14px; font-weight: 500;
  border-radius: var(--auth-radius-btn);
  transition: background var(--auth-t-fast) var(--auth-ease), box-shadow var(--auth-t-fast) var(--auth-ease), opacity var(--auth-t-fast) var(--auth-ease), transform 80ms var(--auth-ease);
  cursor: pointer; user-select: none;
}
.auth-btn:active:not(:disabled) { transform: scale(0.985); }

.auth-btn--primary {
  background: var(--auth-accent); color: var(--auth-text-inverse);
  border: none; margin-top: 4px;
}
.auth-btn--primary:hover:not(:disabled) { background: var(--auth-accent-hover); }
.auth-btn--primary:focus-visible { box-shadow: var(--auth-shadow-focus); outline: none; }
.auth-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-btn--secondary {
  background: var(--auth-bg); color: var(--auth-text);
  border: 1px solid var(--auth-border);
}
.auth-btn--secondary:hover { background: var(--auth-border); }

.auth-btn--google {
  background: var(--auth-bg-card); color: var(--auth-text);
  border: 1px solid var(--auth-border);
}
.auth-btn--google:hover { background: var(--auth-bg); border-color: var(--auth-border-hover); }
.auth-btn--google:focus-visible { box-shadow: var(--auth-shadow-focus); outline: none; }

/* SPINNER */
.auth-btn__spinner svg { animation: authSpin 0.7s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }

/* DIVIDER */
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--auth-border); }
.auth-divider span { font-size: 12px; font-weight: 500; color: var(--auth-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }

/* LINKS */
.auth-link {
  font-size: 14px; font-weight: 500; color: var(--auth-accent);
  background: none; border: none; cursor: pointer; padding: 0;
  transition: color var(--auth-t-fast) var(--auth-ease);
}
.auth-link:hover { color: var(--auth-accent-hover); text-decoration: underline; }
.auth-link--sm { font-size: 13px; font-weight: 400; }

.auth-footer-text { text-align: center; font-size: 14px; color: var(--auth-text-secondary); margin-top: 20px; }

.auth-legal { font-size: 12.5px; color: var(--auth-text-tertiary); text-align: center; line-height: 1.6; }
.auth-legal a { color: var(--auth-text-secondary); text-decoration: underline; text-decoration-color: var(--auth-border); text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--auth-text); }

/* CONFIRM / SUCCESS */
.auth-confirm-content { text-align: center; padding: 12px 0; }
.auth-confirm-icon { margin-bottom: 20px; display: flex; justify-content: center; }
.auth-confirm-content .auth-heading { margin-bottom: 8px; }
.auth-confirm-content .auth-subheading { margin-bottom: 28px; }
.auth-confirm-content .auth-btn { width: 100%; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .auth-form-side { padding: 32px 16px 48px; }
  .auth-card { padding: 24px 20px; }
  .auth-form-wrapper { gap: 20px; }
}
@media (max-width: 400px) {
  .auth-card { padding: 20px 16px; border-radius: 10px; }
  .auth-heading { font-size: 19px; }
  .auth-form-side { padding: 24px 12px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel { animation: none !important; }
  .auth-btn__spinner svg { animation-duration: 1.5s; }
  .auth-tab__indicator { transition: none; }
}
