/* ============================================
   こそだてアプリ デザイン
   ベース: パステル（桜ピンク × 水色）
   ============================================ */

:root {
  --color-pink: #f4a8c4;
  --color-pink-light: #fde0eb;
  --color-blue: #b8d8e8;
  --color-blue-light: #e3f1f7;
  --color-bg: #fff9fb;
  --color-text: #4a3f4d;
  --color-text-light: #8a7d8f;
  --color-white: #ffffff;
  --color-success: #7cc99f;
  --color-error: #e88a8a;
  --shadow-card: 0 4px 20px rgba(244, 168, 196, 0.15);
  --radius-card: 20px;
  --radius-button: 12px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   ログイン画面
   ============================================ */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 40px 30px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 400px;
}

.app-title {
  text-align: center;
  font-size: 28px;
  color: var(--color-pink);
  margin-bottom: 8px;
}

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

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-text);
}

.login-form input[type="email"] {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border: 2px solid var(--color-blue-light);
  border-radius: var(--radius-button);
  margin-bottom: 20px;
  background: var(--color-white);
}

.login-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-pink);
}

/* ============================================
   メイン画面 ヘッダー
   ============================================ */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-pink-light);
}

.app-header h1 {
  font-size: 22px;
  color: var(--color-pink);
}

/* ============================================
   カード
   ============================================ */

.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--color-text);
}

.coming-soon {
  text-align: center;
  color: var(--color-text-light);
  padding: 20px 0;
}

/* ============================================
   絵本リング表示
   ============================================ */

.ring-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--color-blue-light);
  stroke-width: 14;
}

.ring-fg {
  fill: none;
  stroke: var(--color-pink);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 534;
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 0.8s ease;
}

.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.ring-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-pink);
}

.ring-unit {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ============================================
   達成率バー
   ============================================ */

.progress-bar-wrap {
  background: var(--color-blue-light);
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-pink) 0%, var(--color-blue) 100%);
  width: 0%;
  transition: width 0.8s ease;
  border-radius: 8px;
}

.progress-text {
  text-align: center;
  color: var(--color-text-light);
  font-size: 14px;
  margin-bottom: 20px;
}

#progress-percent {
  font-weight: 700;
  color: var(--color-pink);
  font-size: 16px;
}

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

.btn-primary {
  background: var(--color-pink);
  color: var(--color-white);
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-button);
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(244, 168, 196, 0.4);
}

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

.btn-primary:disabled {
  background: #e0d4d9;
  cursor: not-allowed;
}

.btn-large {
  padding: 18px 24px;
  font-size: 18px;
}

.btn-secondary {
  background: var(--color-blue-light);
  color: var(--color-text);
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-button);
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--color-blue);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button-group-row {
  display: flex;
  gap: 10px;
}

.button-group-row button {
  flex: 1;
}

/* ============================================
   日付入力フォーム
   ============================================ */

.date-form {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-blue-light);
  border-radius: var(--radius-button);
}

.date-form label {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.date-form input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid var(--color-blue);
  border-radius: 8px;
  margin-bottom: 8px;
}

.date-form .button-group-row {
  margin-top: 12px;
}

/* ============================================
   メッセージ
   ============================================ */

.message {
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  min-height: 1.5em;
}

.message.success {
  background: rgba(124, 201, 159, 0.15);
  color: var(--color-success);
}

.message.error {
  background: rgba(232, 138, 138, 0.15);
  color: var(--color-error);
}

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

@media (max-width: 480px) {
  .screen {
    padding: 16px;
  }
  .card {
    padding: 20px 18px;
  }
  .app-title {
    font-size: 24px;
  }
}
