/* ============================================
   FenceX - Authentication Layout
   Cinematic hero + glass form container
   ============================================ */

:root {
  --auth-panel-bg: rgba(8, 15, 27, 0.82);
  --auth-panel-border: rgba(104, 154, 255, 0.14);
  --auth-form-surface: rgba(8, 15, 27, 0.82);
  --auth-field-bg: rgba(5, 12, 32, 0.6);
  --auth-field-border: rgba(104, 154, 255, 0.14);
  --auth-muted: rgba(234, 242, 255, 0.55);
}

:root[data-theme='light'] {
  --auth-panel-bg: rgba(255, 255, 255, 0.92);
  --auth-panel-border: rgba(30, 58, 110, 0.1);
  --auth-form-surface: rgba(255, 255, 255, 0.92);
  --auth-field-bg: rgba(244, 247, 255, 0.9);
  --auth-field-border: rgba(30, 58, 110, 0.1);
  --auth-muted: rgba(12, 26, 43, 0.55);
}

body.auth-page {
  background:
    radial-gradient(1000px 520px at 10% -10%, rgba(42, 117, 255, 0.14), transparent 62%),
    linear-gradient(180deg, #040910 0%, #070d16 48%, #050a12 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(70, 132, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 132, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

:root[data-theme='light'] body.auth-page {
  background:
    radial-gradient(980px 520px at 10% -15%, rgba(60, 123, 255, 0.08), transparent 62%),
    linear-gradient(180deg, #f7f9fd 0%, #edf2fa 52%, #e8eef8 100%);
}

:root[data-theme='light'] body.auth-page::before {
  background:
    linear-gradient(rgba(63, 110, 202, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 110, 202, 0.06) 1px, transparent 1px);
  opacity: 0.10;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 0;
  width: min(1200px, calc(100% - 48px));
  margin: 48px auto;
  border-radius: 40px;
  border: 1px solid rgba(104, 154, 255, 0.14);
  overflow: hidden;
  background: rgba(8, 15, 27, 0.82);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

:root[data-theme='light'] .auth-wrapper {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(30, 58, 110, 0.1);
}

.auth-image-section {
  position: relative;
  min-height: 640px;
  overflow: hidden;
}

.auth-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.35) brightness(1.15);
  transform: scale(1.02);
}

.auth-image-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(2, 4, 12, 0.85), rgba(7, 12, 28, 0.4));
  z-index: 1;
}

.login-hero::after {
  background: linear-gradient(140deg, rgba(3, 7, 18, 0.9) 0%, rgba(22, 43, 105, 0.45) 100%);
}

.signup-hero::after {
  background: linear-gradient(150deg, rgba(3, 6, 16, 0.92) 0%, rgba(41, 74, 140, 0.5) 100%);
}

.auth-image-overlay {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 48px;
  padding: 32px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(2, 5, 15, 0.6);
  backdrop-filter: blur(14px);
  z-index: 2;
  color: #ffffff;
}

.auth-image-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.5rem, 4vw, 4rem);
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 12px;
  color: #ffffff;
}

.auth-image-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: rgba(4, 10, 22, 0.6);
}

:root[data-theme='light'] .auth-form-section {
  background: rgba(248, 250, 255, 0.8);
}

.auth-form-container {
  width: 100%;
  max-width: 480px;
  background: rgba(8, 15, 27, 0.82);
  border-radius: 32px;
  padding: 40px;
  border: 1px solid rgba(104, 154, 255, 0.14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  color: var(--color-text-primary, #eaf2ff);
}

:root[data-theme='light'] .auth-form-container {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(30, 58, 110, 0.1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  color: #0c1630;
}

.auth-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.35rem;
  margin-bottom: 12px;
}

.auth-subtitle {
  color: var(--auth-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-message {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  border: 1px solid transparent;
}

.auth-message.error {
  border-color: rgba(255, 82, 82, 0.4);
  background: rgba(255, 74, 74, 0.08);
  color: #ff8c8c;
}

.auth-message.success {
  border-color: rgba(94, 255, 188, 0.4);
  background: rgba(73, 255, 188, 0.08);
  color: #8bffcf;
}

:root[data-theme='light'] .auth-message.success {
  color: #0b8e4d;
}

:root[data-theme='light'] .auth-message.error {
  color: #c53030;
}

.google-signin-wrapper {
  border-radius: 18px;
  border: 1px dashed var(--auth-panel-border);
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 20px;
}

:root[data-theme='light'] .google-signin-wrapper {
  background: rgba(244, 247, 255, 0.6);
}

.google-label {
  font-size: 0.8rem;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--auth-muted);
}

.google-status {
  font-size: 0.8rem;
  color: var(--auth-muted);
  margin-top: 10px;
}

.google-status.error {
  color: #ff8c8c;
}

.auth-divider {
  position: relative;
  margin: 28px 0;
  text-align: center;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--auth-panel-border);
}

.divider-text {
  position: relative;
  padding: 0 16px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 0.8rem;
  letter-spacing: 0.25rem;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--auth-muted);
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--auth-field-border);
  background: var(--auth-field-bg);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 10px 25px rgba(90, 141, 255, 0.2);
  outline: none;
}

.form-options {
  text-align: right;
  margin-bottom: 18px;
}

.forgot-link {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text-primary);
  position: relative;
}

.forgot-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.4;
}

.auth-submit-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 18px 24px;
  background: var(--color-accent, #3b82f6);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 24px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 35px rgba(33, 123, 255, 0.25);
}

.auth-switch {
  text-align: center;
  font-size: 0.95rem;
  color: var(--auth-muted);
}

.auth-link {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

.auth-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  opacity: 0.3;
}

.auth-terms {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--auth-muted);
  text-align: center;
  line-height: 1.6;
}

.auth-terms a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    margin: 32px auto;
  }

  .auth-image-section {
    min-height: 360px;
  }

  .auth-image-overlay {
    left: 32px;
    right: 32px;
    bottom: 32px;
  }
}

@media (max-width: 640px) {
  .auth-wrapper {
    width: calc(100% - 32px);
    border-radius: 28px;
  }

  .auth-form-section {
    padding: 32px 24px;
  }

  .auth-form-container {
    padding: 28px;
  }

  .auth-image-overlay {
    padding: 24px;
  }
}
