/* === APP PAGE STYLES === */

.nav-back {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.nav-back:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.app-header {
  margin-bottom: 36px;
  text-align: center;
}

.app-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.app-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === UPLOAD ZONE === */
.upload-zone {
  width: 100%;
}

.upload-zone-inner {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--white);
  position: relative;
}

.upload-zone-inner:hover,
.upload-zone-inner.drag-over {
  border-color: var(--navy);
  background: var(--bg);
}

.upload-zone-inner.has-file {
  padding: 24px;
}

.upload-icon {
  margin: 0 auto 16px;
  display: block;
}

.upload-primary {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* === PREVIEW === */
.preview-container {
  margin-top: 16px;
  text-align: center;
}

.preview-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: contain;
}

/* === ANALYZE BUTTON === */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 24px;
  background: var(--navy);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

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

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

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

/* === ERROR === */
.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.875rem;
}

/* === RESULTS === */
.results {
  animation: fadeUp 0.3s ease-out;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.results-check {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.results-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-ghost {
  margin-left: auto;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* === RESULT CARDS === */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy);
}

.card-summary {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
}

/* Deadlines */
.deadline-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.deadline-list,
.amount-list,
.next-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadline-item {
  font-size: 0.9375rem;
  color: var(--navy);
  font-weight: 500;
  padding: 8px 12px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #fde68a;
}

/* Amounts */
.amount-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.amount-item {
  font-size: 1rem;
  font-weight: 600;
  color: #15803d;
  padding: 8px 12px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #bbf7d0;
}

/* Next Steps */
.next-card {
  border-color: var(--border);
}

.next-item {
  font-size: 0.9375rem;
  color: var(--text);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.next-item::before {
  content: '→';
  color: var(--navy);
  font-weight: 600;
  flex-shrink: 0;
}

/* Raw text */
.raw-text-section {
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.raw-toggle {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.raw-toggle:hover {
  color: var(--text);
}

.raw-content {
  padding: 16px;
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

/* === PROGRESS INDICATOR === */
.progress-container {
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.progress-step.active {
  color: var(--navy);
  font-weight: 500;
}

.progress-step.done {
  color: #16a34a;
}

.progress-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--white);
  transition: all 0.3s ease;
}

.progress-step.active .progress-step-icon {
  border-color: var(--navy);
  background: var(--navy);
}

.progress-step.active .progress-step-icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
  animation: pulse-dot 1s ease-in-out infinite;
}

.progress-step.done .progress-step-icon {
  border-color: #16a34a;
  background: #f0fdf4;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.progress-check {
  width: 12px;
  height: 12px;
  display: none;
}

.progress-step.done .progress-check {
  display: block;
}

.progress-step-text {
  flex: 1;
}

.progress-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 4px;
}

/* Utility */
.hidden { display: none !important; }

/* === REMINDER === */
.reminder-section {
  margin-top: 12px;
}

.reminder-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reminder-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminder-row {
  display: flex;
  gap: 8px;
}

.reminder-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  flex: 1;
}

.reminder-input:focus {
  outline: none;
  border-color: var(--navy);
}

.reminder-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.reminder-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  color: #15803d;
  font-size: 0.875rem;
  font-weight: 500;
}

.reminder-error {
  margin-top: 6px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #dc2626;
  font-size: 0.8125rem;
}

/* === MOBILE === */
  .app-container {
    padding: 32px 16px 60px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-ghost {
    margin-left: 0;
    width: 100%;
  }
}