:root {
  --auth-primary: #6c63ff;
  --auth-primary-dark: #4b32d9;
  --auth-accent: #a18bff;
  --auth-surface: #ffffff;
  --auth-surface-strong: rgba(15, 23, 42, 0.75);
  --auth-on-surface: #0f172a;
  --auth-muted: rgba(15, 23, 42, 0.65);
  --auth-border: rgba(148, 163, 184, 0.35);
  --auth-radius-lg: 28px;
  --auth-radius-md: 16px;
  --auth-radius-pill: 999px;
  --auth-shadow-card: 0 30px 80px rgba(15, 23, 42, 0.28);
  --auth-shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.18);
  --auth-gradient:
    radial-gradient(circle at 10% 20%, rgba(108, 99, 255, 0.35), transparent 55%),
    radial-gradient(circle at 85% 0%, rgba(161, 139, 255, 0.35), transparent 60%),
    linear-gradient(135deg, #090b1d, #191233 55%, #2f1e7a);
}

[data-theme='dark'] {
  --auth-surface: #0f172a;
  --auth-surface-strong: rgba(15, 23, 42, 0.9);
  --auth-on-surface: #e2e8f0;
  --auth-muted: rgba(226, 232, 240, 0.7);
  --auth-border: rgba(148, 163, 184, 0.35);
  --auth-shadow-card: 0 30px 80px rgba(2, 6, 23, 0.6);
  --auth-shadow-soft: 0 20px 50px rgba(2, 6, 23, 0.5);
  --auth-gradient:
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.3), transparent 55%),
    radial-gradient(circle at 85% 0%, rgba(129, 140, 248, 0.3), transparent 60%),
    linear-gradient(135deg, #020617, #0f172a 55%, #1e1b4b);
}

* {
  box-sizing: border-box;
}

body.auth-page {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-gradient);
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--auth-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-shell {
  width: 100%;
  max-width: 1100px;
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 540px;
  }
}

.auth-panel {
  position: relative;
  background: rgba(20, 16, 40, 0.38);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--auth-radius-lg);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f8fafc;
  overflow: hidden;
  box-shadow: var(--auth-shadow-card);
  backdrop-filter: blur(18px);
}

@media (max-width: 980px) {
  .auth-panel {
    min-height: 240px;
  }
}

.auth-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(108, 99, 255, 0.28), transparent 55%);
  pointer-events: none;
}

.auth-panel__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--auth-radius-pill);
  background: rgba(108, 99, 255, 0.18);
  color: #ede9fe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.auth-panel__tag::before {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 0;
  background: transparent url('../assets/logo/truckpoi.svg') center/20px 20px no-repeat;
  box-shadow: none;
}

.auth-panel__title {
  margin-top: 24px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.15;
}

.auth-panel__subtitle {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(241, 245, 249, 0.85);
  max-width: 360px;
}

.auth-panel__footer {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: rgba(226, 232, 240, 0.75);
}

.auth-card {
  background: var(--auth-surface);
  border-radius: var(--auth-radius-lg);
  border: 1px solid rgba(108, 99, 255, 0.14);
  padding: 48px;
  box-shadow: var(--auth-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-card__tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.auth-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--auth-radius-pill);
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid var(--auth-border);
}

.auth-lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--auth-radius-pill);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-lang-switch a:hover {
  color: var(--auth-on-surface);
}

.auth-lang-switch a.is-active {
  background: rgba(108, 99, 255, 0.2);
  color: var(--auth-on-surface);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--auth-radius-pill);
  border: 1px solid var(--auth-border);
  background: transparent;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  color: var(--auth-on-surface);
  border-color: rgba(108, 99, 255, 0.5);
}

.theme-toggle.is-dark {
  color: var(--auth-on-surface);
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(108, 99, 255, 0.16);
}

@media (max-width: 600px) {
  .auth-card__tools {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 32px 24px;
  }
}

.auth-card__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-card__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--auth-primary-dark);
  letter-spacing: 0.08em;
  text-transform: none;
}

.auth-card__brand::before {
  content: '';
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: transparent url('../assets/logo/truckpoi.svg') center/26px 26px no-repeat;
  border: none;
  box-shadow: none;
}

.auth-card__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--auth-on-surface);
}

.auth-card__subtitle {
  font-size: 15px;
  color: var(--auth-muted);
  line-height: 1.6;
}

.auth-alert {
  padding: 14px 18px;
  border-radius: var(--auth-radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.auth-alert--error {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
}

.auth-field--checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--auth-primary);
}

.auth-field--checkbox label {
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-muted);
  cursor: pointer;
}

.auth-field--checkbox label a {
  color: var(--auth-primary);
  text-decoration: underline;
}

.auth-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-input {
  width: 100%;
  border-radius: var(--auth-radius-md);
  border: 1px solid var(--auth-border);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--auth-on-surface);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme='dark'] .auth-input {
  background: rgba(15, 23, 42, 0.85);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(108, 99, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.16);
  background: #fff;
}

[data-theme='dark'] .auth-input:focus {
  background: rgba(15, 23, 42, 0.95);
}

.auth-input::placeholder {
  color: rgba(15, 23, 42, 0.35);
}

[data-theme='dark'] .auth-input::placeholder {
  color: rgba(226, 232, 240, 0.4);
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-checkbox input[type='checkbox'] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--auth-primary);
}

.auth-terms-note {
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-social__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-social-button {
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--auth-on-surface);
  font-family: 'Roboto', 'Poppins', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.auth-social-button:hover {
  transform: translateY(-1px);
}

.auth-social-button--google {
  background: #ffffff;
  border-color: #747775;
  color: #1f1f1f;
}

.auth-social-button--google:hover {
  background: #f8f9fa;
  border-color: #5f6368;
}

.auth-social-button--apple {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
}

.auth-social-button--apple:hover {
  background: #111111;
}

.auth-social-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.auth-social-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-social-icon--apple {
  width: 20px;
  height: 20px;
  transform: translateY(-1px);
}

.auth-social-text {
  white-space: nowrap;
}

.auth-divider {
  position: relative;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(108, 99, 255, 0.7);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.auth-divider span {
  background: var(--auth-surface);
  padding: 0 12px;
  position: relative;
  z-index: 1;
}

.auth-submit {
  width: 100%;
  padding: 16px;
  border-radius: var(--auth-radius-md);
  border: none;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.auth-submit:disabled {
  cursor: not-allowed;
  filter: grayscale(0.3);
  opacity: 0.7;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.auth-links a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.8);
}

.auth-helper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.auth-toggle {
  background: none;
  border: none;
  color: var(--auth-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

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

.cf-turnstile-shell,
.cf-turnstile {
  transform-origin: left top;
  width: 100%;
}

@media (max-width: 480px) {
  .cf-turnstile-shell iframe,
  .cf-turnstile iframe {
    transform: scale(0.9);
    transform-origin: left top;
  }
}

.auth-message {
  font-size: 13px;
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 14px 18px;
  border-radius: var(--auth-radius-md);
}

.auth-error-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.auth-error-list li {
  list-style: square;
}

.auth-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.auth-badge {
  padding: 6px 14px;
  border-radius: var(--auth-radius-pill);
  background: rgba(226, 232, 240, 0.16);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-double {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .auth-double {
    grid-template-columns: 1fr;
  }
}

.auth-small {
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
  margin: 24px 0 6px;
}

.auth-disclosure {
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-md);
  padding: 16px 16px 10px;
  background: rgba(255, 255, 255, 0.6);
  margin: 24px 0 6px;
}

.auth-disclosure__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.auth-disclosure__summary::-webkit-details-marker {
  display: none;
}

.auth-disclosure__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.auth-disclosure__chevron {
  width: 16px;
  height: 16px;
  border-right: 2px solid rgba(15, 23, 42, 0.55);
  border-bottom: 2px solid rgba(15, 23, 42, 0.55);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.auth-disclosure[open] .auth-disclosure__chevron {
  transform: rotate(-135deg);
}

.auth-disclosure__content {
  margin-top: 12px;
}

.auth-error-text {
  color: #b91c1c;
  font-size: 13px;
}

.password-strength,
.password-confirmation-message {
  font-size: 13px;
  font-weight: 600;
}

.password-strength.weak,
.password-confirmation-message.error {
  color: #b91c1c;
}

.password-strength.medium {
  color: #d97706;
}

.password-strength.strong,
.password-confirmation-message.success {
  color: #15803d;
}

.auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
  margin-left: 8px;
}

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