
/* ========== Login (split hero + panel) ========== */
:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-surface: #ffffff;
  --auth-primary: #4c44ec;
  --auth-primary-dark: #312fab;
  --auth-primary-soft: rgba(76, 68, 236, 0.12);
  --auth-text: #0f172a;
  --auth-text-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-danger: #ef4444;
  --auth-danger-soft: rgba(239, 68, 68, 0.1);
  --auth-danger-border: rgba(239, 68, 68, 0.35);
  --auth-success: #16a34a;
  --auth-success-soft: rgba(22, 163, 74, 0.1);
  --auth-success-border: rgba(22, 163, 74, 0.35);
}

.auth-login {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(120deg, #eef2ff 0%, #f5f6fb 45%, #eef6ff 100%);
  color: var(--auth-text);
  overflow-x: hidden;
}

.auth-login *,
.auth-login *::before,
.auth-login *::after {
  box-sizing: border-box;
}

.auth-page {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100dvh;
}

/* ---------- Hero / brand panel ---------- */
.auth-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #4f46e5 0%, #4338ca 42%, #6d28d9 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px clamp(40px, 6vw, 84px);
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 8% 92%, rgba(255, 255, 255, 0.12), transparent 42%);
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.35;
  z-index: 0;
  animation: auth-float 15s ease-in-out infinite;
}
.auth-blob--1 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 30% 30%, #a78bfa, #7c3aed);
  top: -90px;
  right: -60px;
}
.auth-blob--2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle at 30% 30%, #22d3ee, #0ea5e9);
  bottom: -90px;
  left: -40px;
  animation-delay: -6s;
}
@keyframes auth-float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-24px) translateX(14px); }
}

.auth-page .hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
}
.hero-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.hero-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.auth-page .hero-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.22;
  margin: 0 0 0.75rem;
}

.auth-page .hero-subtitle {
  font-size: clamp(0.92rem, 1.6vw, 1.02rem);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
  margin: 0;
}

.hero-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}
.hero-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.feature-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.feature-ico svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

/* ---------- Form panel ---------- */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.auth-panel-inner {
  background: var(--auth-surface);
  border-radius: 22px;
  width: 100%;
  max-width: 430px;
  min-height: 620px;
  padding: clamp(2.5rem, 4vw, 3.5rem);
  box-shadow: 0 30px 70px -30px rgba(30, 41, 59, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
}

.panel-logo {
  display: none;
  text-align: center;
}
.panel-logo img {
  max-height: 54px;
  max-width: 180px;
  object-fit: contain;
}

.auth-page .panel-title {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.auth-page .panel-subtitle {
  font-size: 0.92rem;
  color: var(--auth-text-muted);
  line-height: 1.55;
  margin: 0;
}

.auth-page .auth-panel-inner form {
  display: grid;
  gap: 1.1rem;
}

.auth-page .field {
  display: grid;
  gap: 0.5rem;
}
.auth-page .field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.auth-page .input-shell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1.5px solid var(--auth-border);
  border-radius: 12px;
  padding: 0 0.85rem;
  background: #f8fafc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.auth-page .input-shell:focus-within {
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.auth-page .input-addon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex: 0 0 auto;
}
.auth-page .input-shell:focus-within .input-addon {
  color: var(--auth-primary);
}
.auth-page .input-addon svg {
  width: 19px;
  height: 19px;
}

.auth-page .input-shell input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.82rem 0;
  font-size: 0.95rem;
  color: var(--auth-text);
}
.auth-page .input-shell input::placeholder {
  color: #b6c0cf;
}
.auth-page .input-shell input:focus {
  outline: none;
}

.auth-page .toggle-password {
  border: none;
  background: transparent;
  color: var(--auth-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  flex: 0 0 auto;
}
.auth-page .toggle-password:hover {
  background: var(--auth-primary-soft);
}

.auth-page .form-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 0.5rem;
  margin-top: -0.3rem;
}

.auth-page .auth-btn {
  padding: 0.95rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 14px 26px -12px rgba(79, 70, 229, 0.7);
  transition: transform 0.12s ease, box-shadow 0.18s ease, opacity 0.15s ease;
}
.auth-page .auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -12px rgba(79, 70, 229, 0.8);
}
.auth-page .auth-btn:active {
  transform: translateY(0);
}
.auth-page .auth-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.auth-page .auth-btn.auth-is-loading .btn-text {
  display: none;
}
.auth-page .auth-btn .btn-loading {
  display: none;
  align-items: center;
  gap: 0.4rem;
}
.auth-page .auth-btn.auth-is-loading .btn-loading {
  display: inline-flex;
}

.auth-page .auth-link {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-page .auth-link:hover {
  text-decoration: underline;
}

.panel-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 1rem;
}

.auth-page .auth-alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  font-size: 0.9rem;
  line-height: 1.5;
  background: #fff;
  margin: 0;
}
.auth-page .auth-alert ul {
  margin: 0;
  padding-left: 1.1rem;
}
.auth-page .auth-alert.error {
  background: var(--auth-danger-soft);
  border-color: var(--auth-danger-border);
  color: #991b1b;
}
.auth-page .auth-alert.success {
  background: var(--auth-success-soft);
  border-color: var(--auth-success-border);
  color: #065f46;
}

.auth-page .spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 992px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .panel-logo {
    display: block;
  }
  .auth-panel {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .auth-panel {
    padding: 1.75rem;
  }
  .auth-panel-inner {
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .auth-login {
    background: #f4f5fb;
  }
  .auth-panel {
    padding: 1.1rem;
  }
  .auth-panel-inner {
    max-width: 100%;
    min-height: auto;
    border-radius: 18px;
    padding: 1.6rem;
    gap: 1.2rem;
  }
  .auth-page .panel-title {
    font-size: 1.45rem;
  }
  .auth-page .input-shell input {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .auth-panel-inner {
    padding: 1.1rem;
    border-radius: 14px;
    gap: 1rem;
  }
  .auth-page .auth-btn {
    width: 100%;
  }
}

/* Tablet: keep both panels but ease the spacing */
@media (min-width: 993px) and (max-width: 1180px) {
  .auth-page {
    grid-template-columns: 1fr 1fr;
  }
  .auth-hero {
    padding: 56px clamp(28px, 4vw, 56px);
  }
  .auth-page .hero-content {
    gap: 1.8rem;
  }
}

/* Short viewports (landscape phones / small laptops): never clip the card */
@media (max-height: 720px) {
  .auth-page {
    min-height: auto;
  }
  .auth-panel {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
    align-items: flex-start;
  }
  .auth-panel-inner {
    min-height: auto;
  }
  .auth-hero {
    padding-top: 44px;
    padding-bottom: 44px;
  }
  .auth-page .hero-content {
    gap: 1.6rem;
  }
}

/* ========== Simple card screens (verify, passwords) ========== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7ff, #eef9ff);
  padding: 24px;
}

.auth-wrapper .auth-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 28px;
}

.auth-wrapper.auth-card-narrow .auth-card {
  max-width: 480px;
}

.auth-wrapper .auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-wrapper .auth-brand img {
  max-height: 56px;
}

.auth-wrapper .auth-title {
  margin: 10px 0 2px 0;
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
}

.auth-wrapper .auth-subtitle {
  margin: 0 0 18px 0;
  color: #6b7280;
  text-align: center;
  font-size: 14px;
}

.auth-wrapper .form-group {
  margin-bottom: 14px;
}

.auth-wrapper .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

.auth-wrapper .auth-input {
  width: 93%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-wrapper .auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-wrapper .form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 16px 0;
}

.auth-wrapper .remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 13px;
}

.auth-wrapper .auth-link {
  font-size: 13px;
  color: #4f46e5;
  text-decoration: none;
}

.auth-wrapper .auth-link:hover {
  color: #4338ca;
  text-decoration: underline;
}

.auth-wrapper .auth-btn {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-wrapper .auth-btn:hover {
  background: #4338ca;
}

.auth-wrapper .auth-alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.auth-wrapper .auth-alert.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-wrapper .auth-alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-wrapper .auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.auth-wrapper .auth-actions--center {
  justify-content: center;
  margin-top: 10px;
}
