/* ============================================
   Pet Platform — Design System & Global Styles
   KH: 株式会社Puppy | Language: Japanese
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
  --primary: #E8732A;
  --primary-light: #F5A623;
  --primary-dark: #C25A10;
  --primary-gradient: linear-gradient(135deg, #E8732A 0%, #F5A623 100%);
  --secondary: #2D6A4F;
  --secondary-light: #40916C;
  --accent: #7B2CBF;
  --accent-light: #9D4EDD;
  --info: #2563EB;
  --success: #059669;
  --warning: #D97706;
  --error: #DC2626;
  --bg: #FBF7F4;
  --bg-alt: #FFF5EE;
  --surface: #FFFFFF;
  --surface-hover: #FFFAF6;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Noto Sans JP', -apple-system, sans-serif;
  --sidebar-width: 260px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; transition: var(--transition); }
input, select, textarea { font-family: var(--font); outline: none; transition: var(--transition); }

/* === Typography === */
h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.9rem;
  transition: var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--primary-gradient); color: white;
  box-shadow: 0 4px 14px rgba(232, 115, 42, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(232, 115, 42, 0.45); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border-light); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; }

/* === Cards === */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-flat { box-shadow: none; border: 1px solid var(--border); }
.card-flat:hover { box-shadow: var(--shadow-sm); }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: rgba(232,115,42,0.12); color: var(--primary); }
.badge-success { background: rgba(5,150,105,0.12); color: var(--success); }
.badge-warning { background: rgba(217,119,6,0.12); color: var(--warning); }
.badge-error { background: rgba(220,38,38,0.12); color: var(--error); }
.badge-info { background: rgba(37,99,235,0.12); color: var(--info); }
.badge-accent { background: rgba(123,44,191,0.12); color: var(--accent); }
.badge-lg { padding: 6px 14px; font-size: 0.85rem; }

/* === Form === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem; background: white;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,115,42,0.15); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-input { resize: vertical; min-height: 100px; }

/* === Grid === */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* === Avatar === */
.avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  object-fit: cover; border: 2px solid white; box-shadow: var(--shadow-sm);
}
.avatar-lg { width: 60px; height: 60px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-gradient); color: white; font-weight: 700;
}

/* === Star Rating === */
.stars { color: #F59E0B; font-size: 0.85rem; letter-spacing: 1px; }

/* === Tags === */
.tag {
  display: inline-block; padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500; background: var(--border-light); color: var(--text-secondary);
}
.tag-active { background: rgba(232,115,42,0.1); color: var(--primary); border: 1px solid var(--primary); }

/* === Progress Bar === */
.progress { height: 6px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-gradient); border-radius: var(--radius-full); transition: width 0.6s ease; }

/* ==== LAYOUT ==== */

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; padding: 0 24px;
}
.header-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--primary); }
.header-brand span { font-size: 1.5rem; }
.header-nav { display: flex; gap: 4px; margin-left: 40px; }
.header-nav a {
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); background: rgba(232,115,42,0.08); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px; border-radius: var(--radius-full); }
.header-user:hover { background: var(--border-light); }

/* Hero */
.hero {
  position: relative; min-height: 540px;
  background: linear-gradient(135deg, #FFF5EE 0%, #FFE8D6 30%, #FFDAB9 60%, #FFC49B 100%);
  display: flex; align-items: center; padding: 100px 60px 60px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,115,42,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '🐕🐈🐾'; position: absolute; bottom: 20px; right: 60px;
  font-size: 4rem; opacity: 0.15;
}
.hero-content { max-width: 560px; z-index: 1; }
.hero-title { font-size: 2.5rem; font-weight: 900; line-height: 1.3; margin-bottom: 16px; }
.hero-title em { font-style: normal; color: var(--primary); }
.hero-desc { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; }
.hero-stats {
  display: flex; gap: 32px; margin-top: 40px; padding-top: 28px;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.hero-stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.hero-visual {
  flex: 1; display: flex; justify-content: center; align-items: center;
  position: relative; z-index: 1;
}
.hero-illustration {
  font-size: 12rem; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-content { margin-top: 64px; }

/* Section */
.section { padding: 60px 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.section-desc { color: var(--text-secondary); margin-bottom: 28px; }

/* Store Card */
.store-card { cursor: pointer; }
.store-card .card-img { position: relative; }
.store-type-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 600; color: white;
}
.store-type-salon { background: #E91E8A; }
.store-type-hotel { background: #7C3AED; }
.store-type-trainer { background: #059669; }
.store-type-hospital { background: #2563EB; }
.store-type-nursery { background: #D97706; }
.store-type-shelter { background: #DC2626; }
.store-info { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.store-name { font-weight: 600; font-size: 1rem; }
.store-meta { display: flex; gap: 12px; color: var(--text-secondary); font-size: 0.8rem; margin-top: 4px; }
.store-price { font-weight: 700; color: var(--primary); font-size: 1rem; }

/* Pet MBTI */
.mbti-section {
  background: linear-gradient(135deg, #7B2CBF 0%, #9D4EDD 50%, #C77DFF 100%);
  color: white; border-radius: var(--radius-xl); padding: 48px;
  text-align: center; position: relative; overflow: hidden;
}
.mbti-section::before {
  content: '🐕'; position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
  font-size: 8rem; opacity: 0.15;
}
.mbti-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; }
.mbti-desc { opacity: 0.9; margin-bottom: 24px; font-size: 1rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.btn-mbti {
  background: white; color: var(--accent);
  padding: 14px 32px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn-mbti:hover { transform: translateY(-2px) scale(1.02); }

/* Adoption Section */
.adoption-card { border-left: 4px solid var(--error); }
.adoption-label { font-size: 0.75rem; color: var(--error); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.pet-profile { display: flex; gap: 16px; align-items: center; }
.pet-avatar { width: 80px; height: 80px; border-radius: var(--radius-lg); object-fit: cover; font-size: 3rem; text-align: center; line-height: 80px; background: #FEE2E2; }
.pet-info { flex: 1; }
.pet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Karte */
.karte-card { border-left: 4px solid var(--info); }
.karte-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.karte-items { display: flex; flex-direction: column; gap: 8px; }
.karte-item { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); font-size: 0.85rem; }
.karte-item-label { color: var(--text-secondary); }
.karte-item-value { font-weight: 600; }

/* Education */
.course-card { cursor: pointer; }
.course-thumb {
  width: 100%; height: 160px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; position: relative;
}
.course-thumb .play-icon {
  position: absolute; width: 48px; height: 48px; background: rgba(255,255,255,0.9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.course-progress { margin-top: 12px; }
.course-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px;
  background: linear-gradient(135deg, #F59E0B, #F97316);
  color: white; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700;
}

/* Payment */
.payment-summary {
  background: linear-gradient(135deg, #1E293B, #334155);
  color: white; border-radius: var(--radius-lg); padding: 24px;
}
.payment-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.9rem; }
.payment-total { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 12px; margin-top: 8px; font-weight: 700; font-size: 1.1rem; }
.stripe-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #635BFF; color: white; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; }

/* Admin Sidebar */
.admin-layout { display: flex; min-height: 100vh; padding-top: 64px; }
.admin-sidebar {
  width: var(--sidebar-width); background: #1E293B; color: white;
  position: fixed; top: 64px; left: 0; bottom: 0;
  padding: 20px 0; overflow-y: auto;
}
.sidebar-section { padding: 0 16px; margin-bottom: 24px; }
.sidebar-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: #94A3B8; margin-bottom: 8px; padding: 0 12px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: #CBD5E1; font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-link.active { background: var(--primary); color: white; }
.sidebar-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.admin-main { flex: 1; margin-left: var(--sidebar-width); padding: 24px; }

/* Stats Cards */
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px; border: 1px solid var(--border-light);
}
.stat-card-icon { font-size: 2rem; margin-bottom: 8px; }
.stat-card-value { font-size: 1.8rem; font-weight: 800; }
.stat-card-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.stat-card-trend { font-size: 0.8rem; font-weight: 600; margin-top: 4px; }
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--error); }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; padding: 12px 16px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); background: var(--bg); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; font-size: 0.85rem; border-bottom: 1px solid var(--border-light); }
tr:hover td { background: var(--surface-hover); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: var(--radius-xl);
  max-width: 560px; width: 90%; max-height: 85vh;
  overflow-y: auto; transform: scale(0.95); transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-light); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; background: transparent; font-size: 1.2rem; color: var(--text-secondary); }
.modal-close:hover { background: var(--border-light); }

/* Toast */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: white; border-radius: var(--radius-md); padding: 14px 20px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  min-width: 300px; animation: slideIn 0.3s ease;
  border-left: 4px solid var(--success);
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-info { border-left-color: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Page Transitions */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.tab {
  padding: 12px 20px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; position: relative;
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); font-weight: 600; }
.tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--primary); border-radius: 2px;
}

/* Calendar */
.calendar-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cal-slot {
  padding: 10px; text-align: center; border-radius: var(--radius-md);
  cursor: pointer; font-size: 0.85rem; border: 1.5px solid var(--border);
  transition: var(--transition);
}
.cal-slot:hover { border-color: var(--primary); background: rgba(232,115,42,0.05); }
.cal-slot.selected { background: var(--primary); color: white; border-color: var(--primary); }
.cal-slot.disabled { opacity: 0.4; pointer-events: none; }

/* Chip Filter */
.chip-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  background: white; border: 1.5px solid var(--border);
  transition: var(--transition);
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Search Bar */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-full); padding: 4px 4px 4px 20px;
  max-width: 600px;
}
.search-bar input { border: none; flex: 1; font-size: 0.95rem; background: transparent; padding: 8px 0; }
.search-bar input:focus { outline: none; }
.search-bar .btn { border-radius: var(--radius-full); }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero { flex-direction: column; padding: 100px 24px 40px; min-height: auto; }
  .hero-visual { margin-top: 40px; }
  .hero-illustration { font-size: 8rem; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .hero-title { font-size: 1.8rem; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .calendar-slots { grid-template-columns: repeat(2, 1fr); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* Utility */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================
   Auth Page Styles
   ============================================ */
.auth-page { display:none; min-height:100vh; background:var(--bg); }
.auth-page.active { display:block; }
.auth-container { display:flex; min-height:100vh; }
.auth-hero {
  flex:1; min-width:420px;
  background: var(--primary-gradient);
  display:flex; align-items:center; justify-content:center;
  color:white; padding:48px;
}
.auth-hero-content { max-width:420px; }
.auth-form-panel {
  flex:1; min-width:420px;
  display:flex; flex-direction:column; justify-content:center;
  padding:48px 56px; background:white;
  max-width:560px;
}
.auth-tabs { display:flex; gap:0; margin-bottom:32px; border-bottom:2px solid var(--border); }
.auth-tab {
  flex:1; padding:12px 16px; border:none; background:none;
  font-size:0.95rem; font-weight:600; color:var(--text-secondary);
  cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px;
  transition: all 0.2s;
}
.auth-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.auth-tab:hover { color:var(--primary-dark); }
.auth-form-content { animation: authFadeIn 0.3s ease; }
@keyframes authFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Demo Quick Login */
.auth-demo-section {
  margin-top:28px; padding-top:24px;
  border-top:1px solid var(--border-light);
}
.auth-demo-label {
  font-size:0.8rem; font-weight:700; color:var(--text-secondary);
  text-transform:uppercase; letter-spacing:0.05em;
  margin-bottom:16px;
}
.auth-demo-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.auth-demo-btn {
  display:flex; flex-direction:column; align-items:center;
  padding:16px 12px; border-radius:var(--radius-lg);
  border:2px solid var(--border); background:white;
  cursor:pointer; transition:all 0.25s;
  text-align:center;
}
.auth-demo-btn:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.auth-demo-icon { font-size:1.8rem; margin-bottom:6px; }
.auth-demo-role { font-size:0.85rem; font-weight:700; color:var(--text); }
.auth-demo-desc { font-size:0.72rem; color:var(--text-muted); margin-top:2px; }
.auth-demo-user:hover { border-color:#3B82F6; background:#EFF6FF; }
.auth-demo-store:hover { border-color:#F59E0B; background:#FFFBEB; }
.auth-demo-shelter:hover { border-color:#10B981; background:#ECFDF5; }
.auth-demo-admin:hover { border-color:#8B5CF6; background:#F5F3FF; }

/* ============================================
   Role Switcher Bar (floating)
   ============================================ */
.role-switcher {
  position:fixed; bottom:0; left:0; right:0; z-index:9999;
  background:rgba(30,41,59,0.95); backdrop-filter:blur(12px);
  padding:10px 20px; display:flex; align-items:center;
  gap:8px; justify-content:center;
  box-shadow:0 -4px 24px rgba(0,0,0,0.2);
  border-top:1px solid rgba(255,255,255,0.1);
}
.role-switcher-label { color:#94A3B8; font-size:0.78rem; font-weight:600; margin-right:4px; }
.role-sw-btn {
  padding:6px 14px; border:1.5px solid rgba(255,255,255,0.15);
  border-radius:var(--radius-full); background:transparent;
  color:#CBD5E1; font-size:0.78rem; font-weight:600;
  cursor:pointer; transition:all 0.2s;
}
.role-sw-btn:hover { background:rgba(255,255,255,0.1); color:white; }
.role-sw-btn.active { background:var(--primary); border-color:var(--primary); color:white; }
.role-sw-user.active { background:#3B82F6; border-color:#3B82F6; }
.role-sw-store.active { background:#F59E0B; border-color:#F59E0B; color:#1E293B; }
.role-sw-shelter.active { background:#10B981; border-color:#10B981; }
.role-sw-admin.active { background:#8B5CF6; border-color:#8B5CF6; }
.role-sw-logout {
  padding:6px 14px; border:1.5px solid rgba(220,38,38,0.4);
  border-radius:var(--radius-full); background:transparent;
  color:#FCA5A5; font-size:0.78rem; font-weight:600;
  cursor:pointer; transition:all 0.2s; margin-left:8px;
}
.role-sw-logout:hover { background:rgba(220,38,38,0.2); color:#FEE2E2; }

/* Add bottom padding to footer when role-switcher is visible */
footer { padding-bottom:60px !important; }

/* === Floating AI Chat Widget === */
#ai-chat-widget {
  position: fixed;
  bottom: 70px;
  right: 28px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#ai-chat-toggle {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2CBF, #C77DFF);
  border: none;
  box-shadow: 0 6px 24px rgba(123,44,191,0.45);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
#ai-chat-toggle:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(123,44,191,0.55); }
#ai-chat-toggle .ai-badge {
  position: absolute; top: -2px; right: -2px;
  width: 18px; height: 18px;
  background: #E8732A; border-radius: 50%;
  border: 2px solid white;
  font-size: 0.55rem; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
}

#ai-chat-box {
  width: 360px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: chatSlideIn 0.25s cubic-bezier(0.4,0,0.2,1);
  max-height: 520px;
}
#ai-chat-box.open { display: flex; }

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

#ai-chat-box .chat-header {
  background: linear-gradient(135deg, #7B2CBF, #C77DFF);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
#ai-chat-box .chat-header h4 {
  color: white; font-size: 0.95rem; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
#ai-chat-box .chat-header .chat-status {
  font-size: 0.72rem; color: rgba(255,255,255,0.8); font-weight: 400;
}
#ai-chat-box .chat-close {
  background: rgba(255,255,255,0.2); border: none;
  color: white; width: 28px; height: 28px;
  border-radius: 50%; font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#ai-chat-box .chat-close:hover { background: rgba(255,255,255,0.35); }

#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 280px; max-height: 340px;
  background: #FAFAFA;
}
#ai-chat-messages::-webkit-scrollbar { width: 4px; }
#ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
#ai-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg-bot {
  background: linear-gradient(135deg, #F3E8FF, #EDE9FE);
  padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  max-width: 88%; font-size: 0.85rem; line-height: 1.55;
  color: var(--text);
}
.chat-msg-user {
  background: var(--primary-gradient);
  color: white; padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  max-width: 88%; font-size: 0.85rem;
  align-self: flex-end; line-height: 1.55;
}
.chat-msg-suggest {
  background: linear-gradient(135deg, #FFF7ED, #FFE8D6);
  border: 1px solid #FED7AA;
  padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 0.8rem; cursor: pointer;
  transition: background 0.2s; margin-top: 2px;
}
.chat-msg-suggest:hover { background: linear-gradient(135deg, #FFE8D6, #FDD0AA); }

#ai-chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  display: flex; gap: 8px; flex-shrink: 0;
  background: white;
}
#ai-chat-input-row input {
  flex: 1; padding: 8px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  font-size: 0.85rem; font-family: var(--font);
  transition: border-color 0.2s;
}
#ai-chat-input-row input:focus { border-color: var(--accent); outline: none; }
#ai-chat-input-row button {
  padding: 8px 16px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, #7B2CBF, #C77DFF);
  color: white; font-size: 0.85rem; font-weight: 600;
  border: none; cursor: pointer; transition: opacity 0.2s;
  white-space: nowrap;
}
#ai-chat-input-row button:hover { opacity: 0.88; }

/* Hide widget when not logged in */
#ai-chat-widget.hidden { display: none; }

@media (max-width:900px) {
  .auth-container { flex-direction:column; }
  .auth-hero { min-width:auto; min-height:240px; padding:32px; }
  .auth-form-panel { min-width:auto; max-width:none; padding:32px 24px; }
  .role-switcher { flex-wrap:wrap; padding:8px 12px; gap:4px; }
  .role-sw-btn, .role-sw-logout { font-size:0.7rem; padding:5px 10px; }
}
