:root {
  --primary: #E86C1C; /* Brand Orange */
  --primary-light: #F39C12;
  --secondary: #10B981; /* Emerald */
  --bg-color: #FFFDF9; /* Slightly warm off-white */
  --surface: #FFFFFF;
  --text-main: #43302B; /* Dark warm brown for text */
  --text-muted: #85726B;
  --border: #FEE7C8;
  --danger: #EF4444;
  --warning: #E86C1C;
  
  --shadow-sm: 0 1px 2px 0 rgba(232, 108, 28, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

/* Mobile-first constraints */
.app-container {
  width: 100%;
  max-width: 480px; /* Simulate mobile on desktop */
  min-height: 100vh;
  background-color: var(--surface);
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
header {
  padding: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* ログイン・パスワード画面用の大サイズロゴ */
.welcome-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px auto 24px auto;
  text-align: center;
  width: 160px;
  height: 176px;
  animation: logoFloat 3s ease-in-out infinite;
}

.welcome-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes logoFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

/* Main Content Area */
main {
  flex: 1;
  padding: 20px;
  padding-bottom: 80px; /* Space for bottom nav */
  overflow-y: auto;
}

/* Typography */
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 16px; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  width: 100%;
}
.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
.btn-secondary {
  background-color: #F1F5F9;
  color: var(--text-main);
}
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--bg-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:active {
  transform: scale(0.98);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  display: flex;
  justify-content: space-around;
  padding: 12px 0 24px 0; /* Extra padding for iOS */
  border-top: 1px solid var(--border);
  z-index: 20;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-item i {
  font-size: 1.5rem;
}
.nav-item.active {
  color: var(--primary);
}

/* Driver Profile / Rating */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--bg-color);
  border: 2px solid var(--border);
}
.rating {
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 1.1rem;
}
.reviews {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

/* Transport Method Cards - Grid */
.transport-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.transport-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.transport-card i {
  font-size: 2rem;
  color: var(--text-muted);
}
.transport-card.selected {
  border-color: var(--primary);
  background-color: rgba(79, 70, 229, 0.05);
}
.transport-card.selected i {
  color: var(--primary);
}
.transport-card.selected .method-name {
  color: var(--primary);
  font-weight: 600;
}

/* Chat UI */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 300px;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
}
.message.received {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.message.sent {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-input-area {
  display: flex;
  padding: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  gap: 8px;
}
.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  outline: none;
}
.chat-input-area button {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Map Mock */
.map-mock {
  width: 100%;
  height: 250px;
  background-image: url('https://images.unsplash.com/photo-1524661135-423995f22d0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=600&q=80');
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.map-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
}
.tracking-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(79, 70, 229, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
