/* =====================================================
   auth.css — Standalone auth stylesheet
   Covers: login page & register/signup page
   ===================================================== */

/* ── Reset ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Page body ───────────────────────────────────── */
body {
  font-family: var(--font-family-base);
  background-color: var(--bg-dash-body);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Background orbs ─────────────────────────────── */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 460px;
  height: 460px;
  background: radial-gradient(
    circle,
    rgba(124, 99, 227, 0.08) 0%,
    transparent 70%
  );
  top: -100px;
  right: -100px;
}

body::after {
  width: 360px;
  height: 360px;
  background: radial-gradient(
    circle,
    rgba(124, 99, 227, 0.05) 0%,
    transparent 70%
  );
  bottom: -80px;
  left: -80px;
}

/* ── Slide-up entrance animation ─────────────────── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Card ────────────────────────────────────────── */
.card {
  position: relative;
  display: flex;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  background: var(--surface-1);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card .illustration {
  flex: 0 0 46%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  border-right: 1px solid var(--border-subtle);
}

.card .illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.card .main-form {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: var(--surface-1);
}

.card .main-form .form-holder {
  width: 100%;
  max-width: 420px;
}

/* ── Brand mark ──────────────────────────────────── */
.brand {
  margin-bottom: 20px;
}

.brand-icon {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(124, 99, 227, 0.25));
}

/* ── Header ──────────────────────────────────────── */
.header {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: var(--color-gray-900);
}

.header p {
  font-size: 14px;
  color: var(--color-gray-500);
  font-weight: 400;
  line-height: 1.45;
}

/* ── Form ────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Field ───────────────────────────────────────── */
.field {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.field:focus-within .field-icon {
  color: var(--color-primary);
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 42px;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--surface-1);
  outline: none;
  font-family: inherit;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.field input::placeholder {
  color: var(--color-gray-400);
  font-weight: 400;
}

.field input:hover {
  border-color: var(--color-gray-400);
}

.field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3.5px var(--color-primary-fade);
  background: var(--surface-1);
}

.field input.valid {
  border-color: var(--color-success);
}

/* ── Field right controls (toggle / check) ───────── */
.field-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-pw {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition);
}

.toggle-pw:hover {
  color: var(--color-primary);
}

/* ── Valid check icon ────────────────────────────── */
.valid-check {
  color: var(--color-success);
  display: none;
  align-items: center;
  justify-content: center;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Row of two ──────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Password strength ───────────────────────────── */
.strength-wrap {
  margin-top: -4px;
  margin-bottom: 2px;
}

.strength-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-gray-200);
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition:
    width 0.3s ease,
    background 0.3s ease;
}

.strength-label {
  font-size: 12px;
  color: var(--color-gray-500);
  font-weight: 500;
}

/* ── Terms checkbox ──────────────────────────────── */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
}

.terms input[type="checkbox"] {
  display: none;
}

.check-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--surface-1);
  margin-top: 1.5px;
}

.check-box svg {
  opacity: 0;
  transition: opacity var(--transition);
  color: #fff;
}

input[type="checkbox"]:checked + .check-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

input[type="checkbox"]:checked + .check-box svg {
  opacity: 1;
}

.terms-label {
  font-size: 13px;
  color: var(--color-gray-600);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.terms-label a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.terms-label a:hover {
  text-decoration: underline;
}

/* ── Form Options (Remember me & Forgot link) ───── */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  display: none;
}

.remember-me .check-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: var(--radius-xs);
  margin-top: 0;
}

.remember-label {
  font-size: 13px;
  color: var(--color-gray-600);
  cursor: pointer;
}

/* ── Forgot link ─────────────────────────────────── */
.forgot {
  text-align: right;
}

.forgot a {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.forgot a:hover {
  text-decoration: underline;
}

/* ── Field hints / helper text ───────────────────── */
.field-hint {
  font-size: 12px;
  color: var(--color-gray-400);
  margin-top: 4px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

/* ── Primary button ──────────────────────────────── */
.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 20px rgba(124, 99, 227, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.99);
  box-shadow: 0 2px 8px rgba(124, 99, 227, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Move link (login / signup switcher) ─────────── */
.move-link {
  text-align: center;
  font-size: 13.5px;
  color: var(--color-gray-500);
  margin-top: 6px;
}

.move-link a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.move-link a:hover {
  text-decoration: underline;
}

/* ── Divider ─────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-gray-400);
  font-size: 12.5px;
  margin: 4px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-main);
}

/* ── Optional badge ──────────────────────────────── */
.opt-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-gray-500);
  background: var(--color-gray-100);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.field.has-opt input {
  padding-right: 74px;
}

/* ── Responsive — Mobile ─────────────────────────── */
@media (max-width: 767px) {
  body {
    padding: 16px 12px;
    align-items: flex-start;
  }

  .card {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
    padding: 28px 20px 24px;
    border-radius: var(--radius-md);
    margin: auto;
  }

  .card .main-form {
    padding: 0;
    width: 100%;
    min-width: unset;
  }

  .card .main-form .form-holder {
    max-width: 100%;
  }

  .card .illustration {
    display: none !important;
  }

  .header h1 {
    font-size: 22px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  body::before {
    top: -120px;
    right: -140px;
  }

  body::after {
    bottom: -100px;
    left: -120px;
  }
}
