/*
  public/css/style.css
  VAULT Portal - スタイルシート
  配置先: vault-portal/public/css/style.css
*/

/* ============================================
   リセット & ベース
   ============================================ */

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

:root {
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-secondary: #64748b;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-surface-hover: #334155;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   ヘッダー
   ============================================ */

.header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-image {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ============================================
   メインコンテンツ
   ============================================ */

.main {
  flex: 1;
  padding: 2rem 1rem;
}

.view {
  display: none;
  max-width: 900px;
  margin: 0 auto;
}

.view.active {
  display: block;
}

/* ============================================
   ローディング
   ============================================ */

   #loadingView.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
  }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* ============================================
   認証画面
   ============================================ */

.auth-container {
  text-align: center;
  padding: 2rem;
}

.auth-container h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.auth-description {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.auth-box {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  margin: 0 auto 2rem;
}

.auth-box p {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.auth-help {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.auth-help a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* ============================================
   ダッシュボード
   ============================================ */

.dashboard-container h1 {
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

/* 現在のプラン */
.current-plan-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.plan-details {
  display: flex;
  gap: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.plan-status {
  font-size: 0.875rem;
}

.plan-status.active {
  color: var(--color-success);
}

.plan-status.canceled {
  color: var(--color-warning);
}

.plan-status.past_due {
  color: var(--color-danger);
}

/* プランカード */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.plan-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid var(--color-border);
  transition: border-color 0.2s, transform 0.2s;
}

.plan-card:hover {
  border-color: var(--color-primary);
}

.plan-card.featured {
  border-color: var(--color-primary);
  position: relative;
}

.plan-card.current {
  border-color: var(--color-success);
}

.plan-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.plan-card-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.plan-card-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.plan-card-badge.featured {
  background-color: var(--color-primary);
  color: white;
}

.plan-card-badge.current {
  background-color: var(--color-success);
  color: white;
}

.plan-card-limit {
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.plan-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* 管理セクション */
.manage-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.manage-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================
   成功画面
   ============================================ */

.success-container,
.error-container {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: var(--color-success);
  color: white;
  font-size: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.error-icon {
  width: 80px;
  height: 80px;
  background-color: var(--color-danger);
  color: white;
  font-size: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-container h1,
.error-container h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.success-message,
.error-message {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.success-actions,
.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   ボタン
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-surface-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger);
  color: white;
}

/* ============================================
   フッター
   ============================================ */

.footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-copyright {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* ============================================
   レスポンシブ
   ============================================ */

@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .plan-cards {
    grid-template-columns: 1fr;
  }

  .manage-options {
    flex-direction: column;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}
/* public/css/style.css に追加 */

/* ============================================
   フォーム要素
   ============================================ */

   .form-group {
    margin-bottom: 1rem;
    text-align: left;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
  }
  
  .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--color-text);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  
  .form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  }
  
  .form-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
  }
  
  .btn-full {
    width: 100%;
  }
  
  .error-message {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 1.25rem;
  }
  
  .auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
  }
  
  .auth-divider::before,
  .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
  }
  
  .auth-divider span {
    padding: 0 1rem;
  }
  
  .auth-help {
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
  }
  
  .auth-help p {
    margin-bottom: 0.5rem;
  }
  
  .auth-help a {
    color: var(--color-primary);
    text-decoration: none;
  }
  
  .auth-help a:hover {
    text-decoration: underline;
  }
  
  /* ボタンのローディング状態 */
  .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .btn.loading {
    position: relative;
    color: transparent;
  }
  
  .btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-top: -0.5rem;
    margin-left: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  /* β版バナー */
.beta-banner {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.beta-banner.grace {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.beta-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.beta-badge, .grace-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 12px;
}