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

:root {
  --font-main: 'Outfit', 'Noto Sans JP', sans-serif;
  
  /* Color Palette */
  --bg-primary: #f5f7fb;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  
  --border-color: #e2e8f0;
  --border-focus: #a5b4fc;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 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 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Layout Containers */
.app-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

/* Top Page Layout (Wide) */
.wide-container {
  max-width: 900px;
  width: 100%;
  padding: 40px 20px;
}

.wide-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
}

/* Brand / Typography */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  font-weight: 700;
  font-size: 24px;
  color: var(--primary);
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

h2.title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  color: var(--text-main);
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 30px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group.row-layout {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.form-group.row-layout .form-input-container {
  flex: 1;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--text-main);
  background-color: #fafbfd;
  transition: var(--transition-normal);
  outline: none;
}

input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

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

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: #c7d2fe;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: #f8fafc;
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
  width: auto;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Links & Navigation */
.footer-text {
  text-align: center;
  margin-top: 25px;
  font-size: 14px;
  color: var(--text-muted);
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-normal);
}

.link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

/* Utility Header / Tools */
.settings-trigger {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-full);
  transition: var(--transition-normal);
}

.settings-trigger:hover {
  background-color: var(--bg-primary);
  color: var(--text-main);
  transform: rotate(45deg);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-muted);
}

/* Alert Notification System (Toast) */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  background-color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border-left: 4px solid var(--text-muted);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left-color: var(--success);
  background-color: var(--success-light);
}

.toast.danger {
  border-left-color: var(--danger);
  background-color: var(--danger-light);
}

.toast.warning {
  border-left-color: var(--warning);
  background-color: var(--warning-light);
}

/* Step Wizard for Regist */
.step-container {
  display: none;
}

.step-container.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
  transform: translateY(-50%);
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 2;
  transition: var(--transition-normal);
  color: var(--text-muted);
}

.step-dot.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step-dot.completed {
  background-color: var(--success);
  border-color: var(--success);
  color: white;
}

/* Loading overlays / spinners */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.btn-secondary .loading-spinner {
  border-top-color: var(--primary);
  border-color: rgba(79, 70, 229, 0.2);
}

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

/* Dashboard styles (for Top Page) */
.dashboard-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fafbfd;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.user-details h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.user-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-body {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.welcome-illustration {
  font-size: 64px;
  margin-bottom: 10px;
  animation: wave 1.2s ease infinite alternate;
  transform-origin: 70% 70%;
  display: inline-block;
}

@keyframes wave {
  0% { transform: rotate( 0.0deg) }
  10% { transform: rotate(14.0deg) }
  20% { transform: rotate(-8.0deg) }
  30% { transform: rotate(14.0deg) }
  40% { transform: rotate(-4.0deg) }
  50% { transform: rotate(10.0deg) }
  60% { transform: rotate( 0.0deg) }
  100% { transform: rotate( 0.0deg) }
}

.welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
}

.welcome-text {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

.dashboard-actions {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  width: 100%;
  max-width: 400px;
}

/* Alert Info Box */
.info-box {
  background-color: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 25px;
  font-size: 13px;
  color: #3730a3;
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.info-box-icon {
  font-size: 16px;
}

/* ─────────────────────────────────────────────
   AIおみくじ
───────────────────────────────────────────── */

.omikuji-section {
  margin: 30px 0;
  padding: 28px;
  background: linear-gradient(135deg, #f0f4ff 0%, #fdf4ff 100%);
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-lg);
  text-align: center;
}

.omikuji-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.omikuji-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.omikuji-btn {
  font-size: 16px;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  transition: var(--transition-normal);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.omikuji-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.omikuji-result {
  margin-top: 24px;
  animation: fadeInUp 0.4s ease;
}

.omikuji-result-inner {
  background: #ffffff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-main);
  text-align: left;
  white-space: pre-wrap;
  box-shadow: var(--shadow-md);
}

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

/* ─────────────────────────────────────────────
   ブログ機能 (Diaries)
───────────────────────────────────────────── */

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.diary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.diary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.diary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.diary-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.diary-card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-normal);
}

.diary-card-title a:hover {
  color: var(--primary);
}

.diary-card-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.diary-card-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.diary-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.diary-form-group {
  margin-bottom: 20px;
}

.diary-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-main);
}

.diary-input, .diary-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--bg-card);
  transition: var(--transition-normal);
}

.diary-input:focus, .diary-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.diary-textarea {
  min-height: 250px;
  resize: vertical;
  line-height: 1.6;
}

.diary-detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.diary-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.3;
}

.diary-detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.diary-detail-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
  white-space: pre-wrap;
}

.diary-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.share-link-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-link-input-group {
  display: flex;
  gap: 8px;
}

.share-link-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #334155;
  font-family: monospace;
}


