/* ============================================
   Studio AI — Login Page Styles
   Uses shared CSS custom properties from style.css
   ============================================ */

/* ── Page Base ── */
.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg-dark);
}

/* ── Wrapper — Full-screen split ── */
.login-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── LEFT PANEL — Visual ── */
.login-visual {
  display: none;
  width: 50%;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  background-size: cover;
  background-position: center;
}

.visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(16, 19, 34, 0.4) 0%,
    rgba(16, 19, 34, 0.2) 40%,
    rgba(16, 19, 34, 1) 100%
  );
  z-index: 10;
}

.visual-tint {
  position: absolute;
  inset: 0;
  background: rgba(43, 75, 238, 0.1);
  mix-blend-mode: overlay;
  z-index: 10;
}

.visual-top {
  position: relative;
  z-index: 20;
  padding: 3rem;
}

.visual-top .logo-icon {
  background: rgba(var(--primary-rgb), 0.2);
}

.visual-bottom {
  position: relative;
  z-index: 20;
  padding: 3rem;
  margin-top: auto;
}

.visual-content {
  max-width: 480px;
}

.visual-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.visual-desc {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Slide dots */
.slide-dots {
  display: flex;
  gap: 0.5rem;
}

.slide-dot {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  width: 1rem;
  transition: all var(--transition-base);
}

.slide-dot.active {
  width: 4rem;
  background: var(--primary);
}

/* ── RIGHT PANEL — Form ── */
.login-form-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg-dark);
  position: relative;
}

/* Mobile logo */
.mobile-logo {
  position: absolute;
  top: 2rem;
  left: 2rem;
}

/* Form container */
.login-form-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.form-header {
  margin-bottom: 1rem;
}

.form-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: #9da1b9;
  font-size: 1rem;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.form-input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border-radius: var(--radius-xl);
  background: #1a1d2d;
  border: 1px solid var(--border-dark);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input::placeholder {
  color: #9da1b9;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #9da1b9;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: #fff;
}

.password-toggle .material-symbols-outlined {
  font-size: 1.25rem;
}

/* Remember / Forgot row */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  border: 1px solid var(--border-dark);
  background: #1a1d2d;
  accent-color: var(--primary);
  cursor: pointer;
  appearance: auto;
}

.checkbox-text {
  font-size: 0.875rem;
  color: #9da1b9;
  user-select: none;
}

.forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.forgot-link:hover {
  color: #6078f5;
}

/* Login button */
.login-btn {
  width: 100%;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(43, 75, 238, 0.2);
  transition: all var(--transition-fast);
  margin-top: 0.5rem;
}

.login-btn:hover {
  background: #2543d4;
  box-shadow: 0 10px 30px rgba(43, 75, 238, 0.3);
  transform: translateY(-1px);
}

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

/* Register text */
.register-text {
  text-align: center;
  color: #9da1b9;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.register-link {
  font-weight: 700;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.register-link:hover {
  color: #6078f5;
}

/* Legal footer links */
.legal-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.legal-links a {
  font-size: 0.75rem;
  color: #475569;
  transition: color var(--transition-fast);
}

.legal-links a:hover {
  color: #94a3b8;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-xl);
  background: rgba(26, 29, 45, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-dark);
  color: #fff;
  font-size: 0.875rem;
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}

.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.toast-error .toast-icon { color: #ef4444; }

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.toast-success .toast-icon { color: #10b981; }

.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.toast-warning .toast-icon { color: #f59e0b; }

.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.toast-info .toast-icon { color: #3b82f6; }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: #9da1b9;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  transition: color var(--transition-fast);
}
.toast-close:hover { color: #fff; }

/* ── Field Error States ── */
.form-group.has-error .form-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.field-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.25rem;
  display: block;
}

/* ── Form Shake Animation ── */
@keyframes formShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.form-shake {
  animation: formShake 0.6s ease;
}

/* ── 2FA Panel ── */
.twofa-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.twofa-header {
  text-align: center;
}

.twofa-icon {
  font-size: 2.5rem;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.twofa-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.twofa-desc {
  color: #9da1b9;
  font-size: 0.9375rem;
}

.twofa-inputs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.twofa-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: #1a1d2d;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition-fast);
  font-family: var(--font-display);
}

.twofa-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.twofa-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: none;
  border: none;
  color: #9da1b9;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: 0.5rem;
  font-family: var(--font-display);
}

.twofa-back:hover { color: #fff; }

/* ── Responsive ── */

/* Show left panel on large screens */
@media (min-width: 1024px) {
  .login-visual {
    display: flex;
  }

  .login-form-panel {
    width: 50%;
    padding: 3rem;
  }

  .mobile-logo {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b3f54;
}
