/* --- AUTH — signin & signup --- */

/* --- Page logo (fixed top-left) --- */

.page-logo {
  position: fixed;
  top: 2rem;
  left: 2.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 27px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1;
  text-decoration: none;
}

.page-logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.page-logo .logo-pixel {
  fill: var(--text);
  animation: logoPixelFill 0.18s ease-out forwards;
  animation-delay: calc(0.3s + var(--d, 0s));
}

@keyframes logoPixelFill {
  to {
    fill: var(--accent);
  }
}

.page-logo .logo-eye {
  fill: #000;
}

.page-logo .logo-eye.blink {
  fill: var(--accent);
}

/* --- Layout --- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
  opacity: 0;
  animation: authFadeIn 0.8s cubic-bezier(0.16, 1, 0.6, 1) 0.1s forwards;
}

.auth-wrapper--centered {
  grid-template-columns: 1fr;
  max-width: 440px;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Promo card (signup left side) --- */

.auth-promo {
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.promo-heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 200;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 1.2rem;
}

.promo-text {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.promo-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.promo-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.promo-feature-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 106, 0, 0.12);
  border-radius: var(--radius-pill);
}

/* --- Auth card --- */

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  padding: 3rem 2.5rem;
}

.auth-heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 200;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* --- Form --- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input::placeholder {
  color: var(--dim);
}

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

/* --- Password toggle --- */

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}

.password-toggle:hover {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.88);
  transition: transform 0.1s ease;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.password-toggle .icon-eye-off {
  position: absolute;
  opacity: 0;
  transform: scale(0.8);
}

.password-toggle.active .icon-eye {
  opacity: 0;
  transform: scale(0.8);
}

.password-toggle.active .icon-eye-off {
  opacity: 1;
  transform: scale(1);
}

.password-toggle.active {
  color: var(--accent);
}

/* --- Checkbox --- */

.form-group--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--bg-hover);
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.form-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.form-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-checkbox-label {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--muted);
  cursor: pointer;
}

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

.form-checkbox-label a:hover {
  text-decoration: underline;
}

/* --- Row layout (remember me + forgot password) --- */

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--muted);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* --- Buttons --- */

.btn {
  position: relative;
  height: 3.2rem;
  padding: 0 2rem;
  border-radius: var(--radius-control);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  z-index: 1;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent);
  color: var(--text);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 0 0 8px rgba(255, 106, 0, 0.2);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 0 0 14px rgba(255, 106, 0, 0.1);
  transition:
    transform 0.1s ease,
    box-shadow 0.4s ease;
}

.btn-secondary {
  background: rgba(255, 106, 0, 0.4);
  color: var(--text);
  overflow: hidden;
  border-radius: var(--radius-control);
  transition: transform 0.4s ease;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: 0 50%;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: all 0.475s;
  z-index: -1;
}

.btn-secondary:hover {
  transform: scale(1.02);
}

.btn-secondary:hover::before {
  transform: scaleX(1);
}

.btn-secondary:active {
  transform: scale(0.92);
}

.btn-full {
  width: 100%;
}

.btn-oauth {
  width: 100%;
  height: 3.2rem;
  padding: 0 2rem;
  border-radius: var(--radius-control);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none; /* a link to /auth/google/start/, styled as a button */
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.btn-oauth:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Divider --- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Switch link --- */
.auth-switch {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--muted);
}

.auth-switch a {
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* --- Notices and hints --- */

/* No display here: a display value would override the notice's [hidden] */
.auth-notice {
  margin-bottom: 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-surface);
  background: var(--accent-dim);
}

.auth-notice-title {
  color: var(--text);
  font-weight: 500;
}

.auth-notice .btn {
  margin-top: 1rem;
}

.auth-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-hint a {
  color: var(--accent);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .page-logo {
    top: 1.2rem;
    left: 1.5rem;
  }

  .auth-page {
    padding: 5rem 1rem 2rem;
  }

  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-promo {
    padding: 2rem 1.5rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }
}
