/* Custom Authentication Layout - Finn */

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

body {
  min-height: 100vh;
  background-color: var(--bg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--white);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.theme-toggle-btn:hover {
  transform: scale(1.05) rotate(15deg);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-light);
}

/* Ambient Glows in the Background */
.ambient-glows {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.glow-1 {
  position: absolute;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(204, 90, 55, 0.07) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

.glow-2 {
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(229, 159, 84, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

[data-theme="dark"] .glow-1 {
  background: radial-gradient(circle, rgba(229, 159, 84, 0.05) 0%, transparent 70%);
}

[data-theme="dark"] .glow-2 {
  background: radial-gradient(circle, rgba(204, 90, 55, 0.03) 0%, transparent 70%);
}

/* Left Sidebar - Showcase & Visual Identity */
.auth-sidebar {
  position: relative;
  background: linear-gradient(135deg, var(--bg) 0%, var(--input-bg) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem;
  overflow: hidden;
  z-index: 2;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Dynamic grid pattern overlay */
.auth-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(var(--border) 1px, transparent 1px), 
    radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}

.sidebar-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  margin: auto 0;
}

.sidebar-header {
  margin-bottom: 2.5rem;
}

.sidebar-header .logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.sidebar-content h1 {
  font-family: "Outfit", sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.sidebar-content h1 span {
  background: linear-gradient(135deg, var(--primary) 30%, #E59F54 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-content p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 500;
  margin-bottom: 3rem;
}

/* Floating Bento Mockup Cards */
.bento-mockup {
  position: relative;
  width: 100%;
  height: 380px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
}

.mockup-card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  width: 320px;
}

.mockup-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary);
}

/* Card 1 - Balance & Sparkline */
.card-balance {
  top: 10px;
  left: 0;
  z-index: 4;
}

.card-balance .card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-balance .balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-balance .balance-val {
  font-family: "Outfit", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-balance .badge-trend {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .card-balance .badge-trend {
  background-color: rgba(229, 159, 84, 0.1);
  color: #E59F54;
}

.card-balance .sparkline {
  width: 100%;
  height: 40px;
}

/* Card 2 - Categorized Budget (Progress) */
.card-budget {
  bottom: 20px;
  right: 0;
  z-index: 3;
}

.card-budget .budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-budget .budget-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-budget .budget-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.card-budget .progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--input-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.card-budget .progress-fill {
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, var(--primary) 0%, #E59F54 100%);
  border-radius: 4px;
}

.card-budget .budget-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Card 3 - AI Advice Hint */
.card-ai-advice {
  top: 130px;
  left: 100px;
  z-index: 5;
  width: 300px;
}

.card-ai-advice .advice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}

.card-ai-advice .advice-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
  font-weight: 500;
}

/* Keyframe animations for bento cards floating */
@keyframes float-slow-1 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes float-slow-2 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(-0.5deg); }
}

@keyframes float-slow-3 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.3deg); }
}

.card-float-1 {
  animation: float-slow-1 6s ease-in-out infinite;
}

.card-float-2 {
  animation: float-slow-2 8s ease-in-out infinite;
  animation-delay: 1s;
}

.card-float-3 {
  animation: float-slow-3 7s ease-in-out infinite;
  animation-delay: 2.5s;
}

/* Right Content Area - Elegant Form Wrapper */
.auth-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background-color: var(--bg);
  position: relative;
  z-index: 2;
  transition: background-color 0.3s ease;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 380px;
  position: relative;
}

.mobile-header {
  display: none;
  margin-bottom: 2.5rem;
}

.mobile-header .logo {
  margin-bottom: 1.5rem;
}

.mobile-header .logo img {
  height: 44px;
  width: auto;
}

.auth-form-wrapper h2 {
  font-family: "Outfit", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-form-wrapper .subtitle {
  color: var(--text-muted);
  margin-bottom: 2.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Modern inputs and icons */
.input-group {
  position: relative;
  margin-bottom: 1.35rem;
}

.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

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

.input-wrapper i.input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--white);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: 0 2px 4px rgba(42, 36, 33, 0.01);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background-color: var(--white);
}

/* Icon transform when focused */
.input-wrapper input:focus + i.input-icon,
.input-wrapper input:focus ~ i.input-icon {
  color: var(--primary);
  transform: scale(1.05);
}

/* Password Toggle Icon Button */
.password-toggle-btn {
  position: absolute;
  right: 1.1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--primary);
  transform: scale(1.08);
}

.forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 0.4rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--primary);
}

/* Button & Actions */
.btn-primary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  border: none;
  background-color: var(--primary);
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1.75rem;
  box-shadow: 0 4px 14px rgba(204, 90, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204, 90, 55, 0.35);
}

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

/* Divider styling */
.auth-divider {
  margin: 1.75rem 0;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider:not(:empty)::before {
  margin-right: 1rem;
}

.auth-divider:not(:empty)::after {
  margin-left: 1rem;
}

/* Google Sign-in adjustments */
.google-btn-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
  width: 100%;
  min-height: 44px;
}

.google-btn-container > div {
  width: 100% !important;
  display: flex;
  justify-content: center;
}

/* Form Footer Links */
.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease, border-bottom 0.2s ease;
  border-bottom: 1px solid transparent;
}

.auth-footer a:hover {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .auth-container {
    grid-template-columns: 1fr 1fr;
  }
  .auth-sidebar {
    padding: 3rem;
  }
  .bento-mockup {
    transform: scale(0.85);
    transform-origin: left center;
  }
}

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
  }
  
  .auth-sidebar {
    display: none;
  }
  
  .auth-content {
    padding: 3rem 1.5rem;
  }
  
  .mobile-header {
    display: block;
  }
  
  .auth-form-wrapper h2 {
    font-size: 1.9rem;
  }
  
  .theme-toggle-btn {
    top: 1.5rem;
    right: 1.5rem;
  }
}

/* Circular Loading Spinner inside button */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  display: inline-block;
}

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

/* Password Strength Indicator */
.password-strength-container {
  margin-top: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.strength-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.strength-value {
  color: var(--text-main);
  font-weight: 700;
}

.strength-bar-track {
  width: 100%;
  height: 6px;
  background-color: var(--input-bg);
  border-radius: 3px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--text-muted);
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.password-requirements {
  margin-top: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 0.25rem;
}

.requirement-item {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.requirement-item i {
  font-size: 0.85rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.requirement-item.satisfied {
  color: var(--success);
}

.requirement-item.satisfied i {
  color: var(--success);
  transform: scale(1.1);
}

/* Email Verification Code Inputs layout */
.verification-code-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 2rem 0;
  width: 100%;
}

.code-input {
  width: 50px;
  height: 58px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--white);
  color: var(--text-main);
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: 0 2px 4px rgba(42, 36, 33, 0.01);
}

.code-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background-color: var(--white);
}

.verification-timer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1.5rem;
}

.verification-timer button.resend-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.verification-timer button.resend-link:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.verification-timer button.resend-link:hover:not(:disabled) {
  color: var(--primary-hover);
}

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

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 
    0 10px 15px -3px rgba(42, 36, 33, 0.08),
    0 4px 6px -2px rgba(42, 36, 33, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--primary);
}

/* Toast Types */
.toast-success {
  border-left: 4px solid var(--success);
}
.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning {
  border-left: 4px solid #E59F54;
}
.toast-warning .toast-icon {
  color: #E59F54;
}

/* Inline Alert Banner inside forms */
.inline-alert {
  display: none;
  align-items: center;
  gap: 10px;
  background-color: var(--primary-light);
  border: 1px solid rgba(204, 90, 55, 0.15);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .inline-alert {
  background-color: rgba(229, 159, 84, 0.08);
  border-color: rgba(229, 159, 84, 0.15);
}

.inline-alert-icon {
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
}

[data-theme="dark"] .inline-alert-icon {
  color: #E59F54;
}

.inline-alert-message {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  flex: 1;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
