@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ════════════════════════════════════════════════════════════
   Timber Decors — Auth (warm timber-dark theme)
   Shared by: login, register, forgot-password, reset-password
   ════════════════════════════════════════════════════════════ */

:root {
  --accent: #ff6b47;
  --accent-hover: #ff5733;
  --accent-soft: #ffa07e;
  --timber: #d4a373;
  --accent-glow: rgba(255, 107, 71, 0.25);

  --ink: #f7f0e9;
  --text-sub: rgba(247, 240, 233, 0.72);
  --text-muted: rgba(247, 240, 233, 0.5);

  --line: rgba(212, 163, 115, 0.18);
  --line-hover: rgba(212, 163, 115, 0.4);
  --card: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(0, 0, 0, 0.25);

  --error: #ff9b85;
  --error-bg: rgba(239, 68, 68, 0.12);
  --success: #7fd99a;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #e8b06a;

  --radius: 18px;
  --radius-input: 11px;
  --ring: 0 0 0 3px var(--accent-glow);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --t: 0.2s ease;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════ Page ══════ */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(255, 107, 71, 0.16), transparent 60%),
    radial-gradient(800px 600px at 85% 110%, rgba(212, 163, 115, 0.12), transparent 55%),
    linear-gradient(155deg, #2b1d12 0%, #1c140d 55%, #120c08 100%);
  background-attachment: fixed;
}

/* Subtle wood-grain texture overlay */
.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: repeating-linear-gradient(
    95deg,
    #fff 0px, #fff 1px,
    transparent 1px, transparent 4px,
    #fff 4px, #fff 5px,
    transparent 5px, transparent 11px
  );
}

/* ══════ Wrapper ══════ */
.auth-wrapper {
  width: 100%;
  max-width: 430px;
  position: relative;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-wrapper-wide {
  width: 100%;
  max-width: 880px;
  position: relative;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ══════ Card ══════ */
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ══════ Logo ══════ */
.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 30px;
  text-decoration: none;
  width: 100%;
  animation: float 4.5s ease-in-out infinite;
}

/* Soft warm glow behind the logo */
.auth-logo::after {
  content: "";
  position: absolute;
  inset: -90% 30%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 107, 71, 0.28), transparent 72%);
  filter: blur(16px);
  animation: glow 3.4s ease-in-out infinite;
}

.auth-logo img {
  position: relative;
  height: 44px;
  max-width: 78%;
  width: auto;
}

/* ══════ Header ══════ */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-sub);
  margin: 0;
  line-height: 1.5;
}

/* ══════ Form ══════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* ══════ Inputs ══════ */
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.form-input::placeholder { color: var(--text-muted); }
.form-input:hover { border-color: var(--line-hover); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: rgba(0, 0, 0, 0.32);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* ══════ Input with icon ══════ */
.input-icon-group { position: relative; }
.input-icon-group .form-input { padding-left: 44px; }
.input-icon-group .form-input.has-toggle { padding-right: 44px; }

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--t);
  z-index: 1;
}

.input-icon-group:focus-within > .input-icon { color: var(--accent); }

/* ══════ Grid (register) ══════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
}

.form-grid .span-full { grid-column: 1 / -1; }

/* ══════ Password toggle ══════ */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t);
  border-radius: 6px;
  z-index: 1;
}

.password-toggle:hover { color: var(--ink); }
.password-toggle svg { width: 18px; height: 18px; }

/* ══════ Options ══════ */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.forgot-link {
  font-size: 13px;
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}

.forgot-link:hover { color: var(--accent); }

/* ══════ Checkbox ══════ */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--line-hover);
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  background: var(--input-bg);
  margin-top: 1px;
}

.form-checkbox input[type="checkbox"]:hover { border-color: var(--accent-soft); }

.form-checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus-visible { box-shadow: var(--ring); }

.form-checkbox label {
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  line-height: 1.5;
}

.form-checkbox label a {
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}

.form-checkbox label a:hover { color: var(--accent); text-decoration: underline; }

/* ══════ Button ══════ */
.btn-submit {
  width: 100%;
  height: 48px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: all var(--t);
  box-shadow: 0 8px 24px rgba(255, 107, 71, 0.28);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 12px 30px rgba(255, 107, 71, 0.4);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(255, 107, 71, 0.28);
}

.btn-submit:focus-visible { outline: none; box-shadow: var(--ring); }

/* Button loading */
.btn-submit.loading { pointer-events: none; opacity: 0.8; }

.btn-submit .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-submit.loading .btn-spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }

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

/* ══════ Footer ══════ */
.auth-footer-text {
  text-align: center;
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-sub);
}

.auth-footer-text a {
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--t);
}

.auth-footer-text a:hover { color: var(--accent); }

.auth-copy {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════ Alerts ══════ */
.success-message {
  background: var(--success-bg);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  margin-bottom: 24px;
}

.success-message p {
  color: var(--success);
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-message svg { width: 18px; height: 18px; flex-shrink: 0; }

.error-alert {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  margin-bottom: 24px;
}

.error-alert p {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-alert p:last-child { margin-bottom: 0; }
.error-alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.error-message {
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
  margin-top: 4px;
}

/* ══════ Password strength ══════ */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  transition: background 0.3s ease;
}

.strength-bar.weak { background: var(--error); }
.strength-bar.medium { background: var(--warning); }
.strength-bar.strong { background: var(--success); }

.strength-text {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.strength-text.weak { color: var(--error); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* ══════ Register split card ══════ */
.auth-card-split {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-card-brand {
  width: 280px;
  min-width: 280px;
  background:
    radial-gradient(500px 300px at 20% 0%, rgba(255, 107, 71, 0.22), transparent 60%),
    linear-gradient(160deg, #34241600 0%, #1d140d 0%, #120c08 100%);
  padding: 44px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.auth-card-brand::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 170px;
  height: 170px;
  background: rgba(255, 107, 71, 0.12);
  border-radius: 50%;
}

.auth-card-brand::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 130px;
  height: 130px;
  background: rgba(212, 163, 115, 0.1);
  border-radius: 50%;
}

.brand-logo {
  display: block;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.brand-logo img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.brand-heading {
  font-size: 23px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.brand-subtext {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.brand-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.brand-features li svg {
  width: 16px;
  height: 16px;
  color: var(--accent-soft);
  flex-shrink: 0;
}

.auth-card-form {
  flex: 1;
  padding: 44px;
}

.auth-card-form .auth-header {
  text-align: left;
  margin-bottom: 28px;
}

.auth-card-form .auth-header h1 { font-size: 23px; }
.auth-card-form .auth-header p { font-size: 13px; }
.auth-card-form .auth-form { gap: 18px; }
.auth-card-form .form-grid { gap: 18px 14px; }

/* ══════ Animations ══════ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ══════ Responsive ══════ */
@media (max-width: 880px) {
  .auth-card-split { flex-direction: column; }
  .auth-card-brand {
    width: 100%;
    min-width: unset;
    padding: 32px 36px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .auth-card-brand::before,
  .auth-card-brand::after { display: none; }
  .brand-logo { margin-bottom: 0; }
  .brand-heading { font-size: 18px; margin-bottom: 4px; }
  .brand-subtext, .brand-features { display: none; }
  .auth-card-form .auth-header { text-align: center; }
}

@media (max-width: 680px) {
  .auth-wrapper-wide { max-width: 430px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card-brand { padding: 24px 28px; }
}

@media (max-width: 480px) {
  .auth-page { padding: 24px 16px; }
  .auth-card { padding: 32px 24px; border-radius: 16px; }
  .auth-card-form { padding: 30px 24px; }
  .auth-header h1 { font-size: 22px; }
  .auth-form { gap: 16px; }
  .form-grid { gap: 16px; }
  .form-input { height: 46px; }
  .btn-submit { height: 46px; }
}

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