/* ==========================================
   DailyGround — Check-In Page Styles
   Mobile-first (375px+), matches landing theme
   ========================================== */

/* ---- CHECK-IN PAGE LAYOUT ---- */
.checkin-page {
  min-height: calc(100vh - 65px);
  padding: 40px 20px 80px;
  background: var(--bg);
}

.checkin-container {
  max-width: 580px;
  margin: 0 auto;
}

/* ---- HEADER ---- */
.checkin-header {
  margin-bottom: 40px;
}

.checkin-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 500;
  color: var(--green-deep);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 8px 0 12px;
}

.checkin-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* AI Summary Banner */
.ai-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--green-deep);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.ai-summary--visible,
.ai-summary--fixed {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ai-summary-icon {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 1px;
}

#summaryText {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
}

/* ---- PILLAR SECTIONS ---- */
.pillar-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.pillar-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.pillar-workout::before { background: var(--workout); }
.pillar-prayer::before { background: var(--prayer); }
.pillar-habit::before { background: var(--habit); }
.pillar-anxiety::before { background: var(--anxiety); }
.pillar-goal::before { background: var(--goal); }

.pillar-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.pillar-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar-workout .pillar-icon { background: rgba(61,100,61,0.1); color: var(--workout); }
.pillar-prayer .pillar-icon { background: rgba(139,115,85,0.1); color: var(--prayer); }
.pillar-habit .pillar-icon { background: rgba(90,110,140,0.1); color: var(--habit); }
.pillar-anxiety .pillar-icon { background: rgba(122,92,122,0.1); color: var(--anxiety); }
.pillar-goal .pillar-icon { background: rgba(201,164,71,0.1); color: var(--goal); }

.pillar-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 2px;
  line-height: 1.2;
}

.pillar-sub {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---- TOGGLE ---- */
.toggle-row {
  margin-bottom: 14px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s ease;
  user-select: none;
}

.toggle-label input:checked + .toggle-track {
  background: var(--green-light);
  border-color: var(--green-mid);
}

.toggle-label input:checked + .toggle-track .toggle-text {
  color: #fff;
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-label input:checked + .toggle-track .toggle-thumb {
  background: #fff;
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}

/* ---- OPTIONAL NOTES ---- */
.optional-notes textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg);
  background: var(--bg);
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
}

.optional-notes textarea::placeholder {
  color: var(--fg-subtle);
}

.optional-notes textarea:focus {
  outline: none;
  border-color: var(--sage);
}

/* ---- HABITS GRID ---- */
.habits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.habit-chip {
  display: inline-flex;
  cursor: pointer;
}

.habit-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.habit-chip-text {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.habit-chip:hover .habit-chip-text {
  border-color: var(--sage);
  color: var(--fg);
}

.habit-chip input:checked + .habit-chip-text {
  background: var(--habit);
  border-color: var(--habit);
  color: #fff;
}

/* ---- ANXIETY SLIDER ---- */
.anxiety-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anxiety-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--fg-subtle);
  font-weight: 500;
}

.anxiety-track-wrap {
  position: relative;
  padding: 16px 0;
}

.anxiety-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--sage-light) 0%,
    var(--sage-light) calc((var(--val, 3) - 1) / 4 * 100%),
    var(--border) calc((var(--val, 3) - 1) / 4 * 100%)
  );
  outline: none;
  cursor: pointer;
}

.anxiety-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--anxiety);
  box-shadow: 0 2px 8px rgba(122,92,122,0.25);
  cursor: pointer;
}

.anxiety-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--anxiety);
  cursor: pointer;
}

.anxiety-dots {
  display: flex;
  justify-content: space-between;
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  pointer-events: none;
}

.anxiety-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
  transform: scale(1);
}

.anxiety-dot.active {
  background: var(--anxiety);
  transform: scale(1.3);
}

.anxiety-value-display {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.anxiety-face {
  font-size: 1.5rem;
  line-height: 1;
}

.anxiety-word {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--anxiety);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- GOALS ---- */
.goals-input-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.goal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.2s;
}

.goal-input::placeholder {
  color: var(--fg-subtle);
}

.goal-input:focus {
  outline: none;
  border-color: var(--sage);
}

.goal-remove-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-alt);
  color: var(--fg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.goal-remove-btn:hover {
  background: rgba(200, 60, 60, 0.1);
  color: #c03030;
}

.add-goal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.add-goal-btn:hover {
  border-color: var(--sage);
  color: var(--fg);
}

/* ---- SUBMIT ---- */
.submit-row {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 40px;
  background: var(--green-mid);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,46,26,0.2);
}

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

.submit-btn--success {
  background: var(--sage) !important;
}

.submit-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .checkin-page { padding: 24px 16px 64px; }
  .pillar-section { padding: 20px 16px; }
  .pillar-section-header { gap: 10px; }
  .pillar-icon { width: 38px; height: 38px; }
  .pillar-name { font-size: 1rem; }
  .habits-grid { gap: 6px; }
  .habit-chip-text { font-size: 0.78rem; padding: 7px 12px; }
  .submit-btn { width: 100%; }
}