/* ==========================================================================
   PicPilot Auth & Dashboard Stylesheet
   ========================================================================== */

:root {
  --paper:        #FAF9F6;
  --paper-card:   #FFFFFF;
  --ink:          #19181C;
  --ink-secondary:#4A4850;
  --fog:          #EAE7E1;
  --fog-subtle:   #F3F1EC;
  --slate:        #6E6D72;
  --slate-light:  #A4A2A8;
  --flash:        #3657FF;
  --flash-hover:  #2542E6;
  --flash-subtle: rgba(54, 87, 255, 0.08);
  --flash-glow:   rgba(54, 87, 255, 0.22);
  --danger:       #E11D48;
  --danger-bg:    #FFF1F2;
  --danger-border:#FECDD3;
  --success:      #059669;
  --success-bg:   #ECFDF5;
  --success-border:#A7F3D0;
  --amber:        #D97706;
  --amber-bg:     #FFFBEB;
  --amber-border: #FDE68A;

  --font: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(25, 24, 28, 0.04), 0 1px 2px rgba(25, 24, 28, 0.02);
  --shadow-card: 0 20px 40px -15px rgba(25, 24, 28, 0.08), 0 0 0 1px rgba(25, 24, 28, 0.05);
  --shadow-focus: 0 0 0 4px var(--flash-subtle);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.25s var(--ease);
}

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

body {
  font-family: var(--font);
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Auth Layout */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  position: relative;
  overflow: hidden;
}

/* Ambient Background Blobs */
.auth-wrapper::before,
.auth-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.auth-wrapper::before {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(54, 87, 255, 0.12) 0%, transparent 70%);
  top: -120px;
  left: -80px;
}

.auth-wrapper::after {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
  bottom: -100px;
  right: -60px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--paper-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(25, 24, 28, 0.07);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 2.25rem;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Brand Header */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.auth-brand span {
  color: var(--flash);
}

.auth-brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--flash-subtle);
  color: var(--flash);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth-subtitle {
  font-size: 0.9375rem;
  color: var(--slate);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* Social Google Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.825rem 1.25rem;
  background: #FFFFFF;
  border: 1.5px solid var(--fog);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-google:hover {
  background: var(--paper);
  border-color: #D3CFCA;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 24, 28, 0.06);
}

.btn-google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--slate-light);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

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

.auth-divider span {
  padding: 0 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

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

.form-label-link {
  font-size: 0.8125rem;
  color: var(--flash);
  text-decoration: none;
  font-weight: 500;
}

.form-label-link:hover {
  text-decoration: underline;
}

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

.input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--slate-light);
  pointer-events: none;
  transition: var(--transition);
}

.form-control {
  width: 100%;
  padding: 0.825rem 1rem 0.825rem 2.75rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--fog);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
}

.form-control.no-icon {
  padding-left: 1rem;
}

.form-control:focus {
  background: #FFFFFF;
  border-color: var(--flash);
  box-shadow: var(--shadow-focus);
}

.form-control.is-invalid {
  border-color: var(--danger);
  background: #FFFBFB;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--ink);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Checkbox */
.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink-secondary);
  user-select: none;
}

.form-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  accent-color: var(--flash);
  cursor: pointer;
}

/* Primary Button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--ink);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(25, 24, 28, 0.15);
  transition: var(--transition);
}

.btn-submit:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(25, 24, 28, 0.25);
}

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

.btn-submit.btn-flash {
  background: var(--flash);
  box-shadow: 0 4px 14px var(--flash-glow);
}

.btn-submit.btn-flash:hover {
  background: var(--flash-hover);
  box-shadow: 0 6px 22px rgba(54, 87, 255, 0.35);
}

/* Card Footer */
.auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--slate);
}

.auth-footer a {
  color: var(--flash);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Alerts & Notices */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #065F46;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #9F1239;
}

.alert-amber {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: #92400E;
}

/* OTP Specific UI */
.otp-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--fog-subtle);
  border: 1px solid var(--fog);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 500;
  margin-top: 0.5rem;
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin: 1.75rem 0 1.25rem;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  text-align: center;
  font-family: 'General Sans', monospace;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--fog);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.otp-box:focus {
  background: #FFFFFF;
  border-color: var(--flash);
  box-shadow: var(--shadow-focus);
  transform: translateY(-2px);
}

.otp-box.is-filled {
  border-color: var(--ink);
  background: #FFFFFF;
}

.otp-timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  color: var(--slate);
}

.otp-timer {
  font-weight: 600;
  color: var(--ink);
}

.btn-resend {
  background: none;
  border: none;
  color: var(--flash);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-resend:disabled {
  color: var(--slate-light);
  cursor: not-allowed;
}

.dev-otp-pill {
  background: linear-gradient(135deg, rgba(54, 87, 255, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px dashed rgba(54, 87, 255, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.dev-otp-pill-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--flash);
  margin-bottom: 0.25rem;
}

.dev-otp-code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--ink);
}

/* Security note */
.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--slate);
  margin-top: 1.5rem;
}

.security-note svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* Dashboard Specific Styles */
.dash-nav {
  height: 72px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--fog);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

.dash-hero-card {
  background: linear-gradient(135deg, #19181C 0%, #292830 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 40px -10px rgba(25, 24, 28, 0.25);
  position: relative;
  overflow: hidden;
}

.dash-hero-card::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(54, 87, 255, 0.35) 0%, transparent 70%);
  right: -50px;
  top: -80px;
  pointer-events: none;
}

.dash-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.dash-stat-card {
  background: #FFFFFF;
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.dash-stat-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-top: 0.35rem;
}

.dash-stat-label {
  font-size: 0.8125rem;
  color: var(--slate);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* User Profile Badge in Nav */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fog);
}

.user-avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--flash-subtle);
  color: var(--flash);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }
  .otp-grid {
    gap: 0.35rem;
  }
  .dash-hero-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem;
  }
}
