/* ============ CSS VARIABLES ============ */
:root {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border-soft: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --text-soft: #cbd5e1;
  --text-mute: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-strong: #0ea5e9;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --warning: #facc15;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ============ RESET ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* ============ AUTH CONTAINER ============ */
.auth-container {
  display: flex;
  min-height: 100vh;
}

/* ============ LEFT SIDE: BRANDING ============ */
.auth-branding {
  flex: 1;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 70%,
      rgba(56, 189, 248, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(96, 165, 250, 0.06) 0%,
      transparent 50%
    );
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(20px, 20px) rotate(5deg);
  }
}

.branding-content {
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.logo-icon {
  font-size: 32px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.branding-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.branding-desc {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 48px;
  max-width: 400px;
}

.branding-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--text-soft);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  transform: translateX(8px);
}

.feature-icon {
  font-size: 20px;
}

.branding-footer {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--text-mute);
}

/* ============ RIGHT SIDE: FORM ============ */
.auth-form-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-secondary);
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
}

.mobile-logo {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.mobile-logo .logo-icon {
  font-size: 28px;
}

.mobile-logo .logo-text {
  font-size: 20px;
  font-weight: 700;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-mute);
}

/* ============ ALERTS ============ */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
}

.alert-error {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-soft);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #86efac;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-text {
  flex: 1;
  line-height: 1.4;
}

/* ============ FORM ============ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

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

.forgot-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 46px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.input-wrapper input::placeholder {
  color: var(--text-mute);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-wrapper input:hover:not(:focus) {
  border-color: rgba(148, 163, 184, 0.35);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toggle-password:hover {
  opacity: 1;
}

/* ============ CHECKBOX ============ */
.checkbox-group {
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.checkbox-label:hover .checkmark {
  border-color: var(--accent);
}

/* ============ BUTTONS ============ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-strong) 100%
  );
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 16px;
  transition: transform 0.2s;
}

.btn-primary:hover .btn-icon {
  transform: translateX(4px);
}

.btn.loading {
  opacity: 0.8;
  pointer-events: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(15, 23, 42, 0.3);
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ DIVIDER ============ */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

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

.divider span {
  font-size: 12px;
  color: var(--text-mute);
  white-space: nowrap;
}

/* ============ SOCIAL BUTTONS ============ */
.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  padding: 14px 20px;
}

.btn-social:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--text);
}

.social-icon {
  flex-shrink: 0;
}

/* ============ AUTH FOOTER ============ */
.auth-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-mute);
  display: flex;
  justify-content: center;
  gap: 6px;
}

.auth-link {
  font-weight: 600;
  color: var(--accent);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .auth-branding {
    display: none;
  }

  .auth-form-container {
    flex: 1;
  }

  .mobile-logo {
    display: flex;
  }
}

@media (max-width: 480px) {
  .auth-form-container {
    padding: 24px 20px;
  }

  .auth-form-wrapper {
    max-width: 100%;
  }

  .auth-title {
    font-size: 24px;
  }

  .social-buttons {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 12px 20px;
  }
}
