/* Auth — đồng bộ landing trắng · xanh SUPPER AI */
:root {
  --lp-green: #3d9e7a;
  --lp-green-dark: #2f7d61;
  --lp-green-light: #8fd4b4;
  --lp-green-50: #f4fbf7;
  --lp-green-100: #e6f5ed;
  --lp-green-200: #c8e6d6;
  --lp-white: #ffffff;
  --lp-bg: #fafcfb;
  --lp-line: #e8eeeb;
  --lp-text: #152420;
  --lp-text-2: #3f5249;
  --lp-text-3: #6d7f76;
  --lp-radius: 12px;
  --lp-shadow: 0 1px 2px rgba(21, 36, 32, 0.04), 0 8px 24px rgba(21, 36, 32, 0.06);
  --lp-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --fx-chrome-light: #ffffff;
}

.hidden {
  display: none !important;
}

.auth-page {
  font-family: var(--lp-font);
  min-height: 100vh;
  color: var(--lp-text-2);
  -webkit-font-smoothing: antialiased;
  background: var(--lp-bg) !important;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(143, 212, 180, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 35% at 0% 100%, rgba(230, 245, 237, 0.9), transparent 50%),
    var(--lp-white);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .auth-shell {
    grid-template-columns: minmax(300px, 40%) 1fr;
  }
}

.auth-showcase {
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 3rem clamp(2rem, 4vw, 3rem);
  border-right: 1px solid var(--lp-line);
  background: linear-gradient(180deg, var(--lp-green-50) 0%, var(--lp-white) 100%);
}

@media (min-width: 900px) {
  .auth-showcase {
    display: flex;
  }
}

.auth-showcase-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
  text-decoration: none;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--lp-green);
}

.auth-brand-text {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lp-text);
}

.auth-brand-supper {
  color: var(--lp-green-dark);
  font-weight: 800;
}

.auth-showcase-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--lp-text);
}

.auth-showcase-lead {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--lp-text-3);
  max-width: 20rem;
}

.auth-showcase-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-showcase-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lp-text-2);
}

.auth-showcase-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--lp-green-dark);
  background: var(--lp-green-50);
  border: 1px solid var(--lp-green-200);
}

.auth-showcase-note {
  margin: 0;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--lp-text-3);
  line-height: 1.5;
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem clamp(0.875rem, 3vw, 1.5rem) 1.5rem;
  min-height: 100vh;
}

.auth-back {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--lp-line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--lp-text-3);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 900px) {
  .auth-back {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
  }
}

.auth-back:hover {
  background: var(--lp-green-50);
  border-color: var(--lp-green-200);
  color: var(--lp-green-dark);
}

.auth-panel {
  position: relative;
  width: 100%;
  max-width: 22.5rem;
  padding: 1.25rem 1.25rem 1.125rem;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  box-shadow: var(--lp-shadow);
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--lp-radius) var(--lp-radius) 0 0;
  background: linear-gradient(90deg, var(--lp-green) 0%, var(--lp-green-light) 100%);
  opacity: 1;
}

.auth-panel--wide {
  max-width: 460px;
}

.auth-panel h1 {
  margin: 0 0 0.125rem;
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--lp-text);
}

.auth-lead {
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  color: var(--lp-text-3);
  line-height: 1.45;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.875rem;
  padding: 2px;
  border-radius: 8px;
  background: var(--lp-green-50);
  border: 1px solid var(--lp-line);
}

.auth-tabs a {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--lp-text-3);
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-tabs a:hover:not(.active) {
  color: var(--lp-green-dark);
}

.auth-tabs a.active {
  color: #fff;
  background: var(--lp-green);
  box-shadow: 0 1px 4px rgba(61, 158, 122, 0.25);
}

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

.auth-field {
  margin-bottom: 0.625rem;
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .auth-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.auth-field label,
.auth-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--lp-text-2);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.5625rem 2.5rem 0.5625rem 0.75rem;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-white);
  color: var(--lp-text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.auth-input-wrap input::placeholder {
  color: #9aada3;
}

.auth-input-wrap input:hover {
  border-color: var(--lp-green-200);
}

.auth-input-wrap input:focus {
  border-color: var(--lp-green);
  box-shadow: 0 0 0 3px rgba(61, 158, 122, 0.15);
}

.auth-field.is-error input {
  border-color: #e57373;
  box-shadow: 0 0 0 2px rgba(229, 115, 115, 0.12);
}

.auth-field-error {
  min-height: 1.1em;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #c62828;
}

.auth-toggle-pw {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.auth-toggle-pw::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236d7f76' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
}

.auth-toggle-pw.is-visible::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236d7f76' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21'/%3E%3C/svg%3E");
}

.auth-toggle-pw:hover {
  opacity: 1;
  background: var(--lp-green-50);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--lp-text-3);
  cursor: pointer;
}

.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--lp-green);
}

.auth-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.auth-plan-opt {
  position: relative;
}

.auth-plan-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-plan-opt label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.3rem;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-white);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin: 0;
}

.auth-plan-opt label strong {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lp-text);
}

.auth-plan-opt label span {
  font-size: 0.625rem;
  color: var(--lp-text-3);
}

.auth-plan-opt input:checked + label {
  border-color: var(--lp-green);
  background: var(--lp-green-50);
}

.auth-plan-opt--pro input:checked + label {
  border-color: var(--lp-green-dark);
  background: var(--lp-green-100);
}

.auth-plan-opt label:hover {
  border-color: var(--lp-green-200);
}

.auth-alert {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid #ef9a9a;
  background: #ffebee;
  color: #c62828;
}

.auth-alert.ok {
  border-color: #a5d6a7;
  background: #e8f5e9;
  color: #2e7d32;
}

.auth-submit {
  width: 100%;
  margin-top: 0;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 9px;
  background: var(--lp-green);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 2px 10px rgba(61, 158, 122, 0.22);
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.auth-submit:disabled,
.auth-submit.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.auth-submit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 40px;
}

.auth-submit-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
}

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

.auth-foot {
  margin: 0.875rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--lp-text-3);
}

.auth-foot a {
  color: var(--lp-green-dark);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-note {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--lp-text-3);
  line-height: 1.45;
}

@media (max-width: 899px) {
  .auth-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.875rem;
    text-decoration: none;
  }

  .auth-mobile-brand .auth-brand-text {
    font-size: 1.25rem;
  }
}

@media (min-width: 900px) {
  .auth-mobile-brand {
    display: none;
  }
}

@media (max-width: 400px) {
  .auth-panel {
    padding: 1.5rem 1.25rem;
  }

  .auth-plans {
    grid-template-columns: 1fr;
  }
}

/* Safari chrome — giữ mép trên trắng */
#fx-safari-chrome-top {
  display: none;
}

@supports (-webkit-touch-callout: none) {
  #fx-safari-chrome-top {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(env(safe-area-inset-top, 0px) + 6px);
    min-height: 6px;
    background-color: var(--fx-chrome-light);
    pointer-events: none;
    z-index: 2147483647;
  }

  .auth-bg {
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    right: 0;
    bottom: 0;
    left: 0;
    inset: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit-spinner {
    animation: none;
  }
}
