@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-alt: #f0ede8;
  --border: #e4dfd8;
  --border-strong: #ccc7bf;

  --text: #1a1714;
  --text-muted: #7a736b;
  --text-light: #b0a89e;

  --accent: #2d6a4f;
  --accent-light: #e8f4ef;
  --accent-hover: #245a41;

  --warn: #b45309;
  --warn-light: #fef3c7;
  --warn-border: #fcd34d;

  --danger: #9b1c1c;
  --danger-light: #fef2f2;
  --danger-border: #fca5a5;

  --ok: #166534;
  --ok-light: #f0fdf4;
  --ok-border: #86efac;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);

  --font-head: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: 0.18s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

input, select, textarea {
  font-family: var(--font-body);
}

/* LAYOUT */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  padding-bottom: 48px;
}

/* HEADER */

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  max-width: 680px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--text);
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius);
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* FORMS */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-light);
}

/* CARDS */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* STATUS BADGES */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-ok {
  background: var(--ok-light);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.badge-warn {
  background: var(--warn-light);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* FILTERS */

.filters {
  display: flex;
  gap: 8px;
  padding: 16px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* PLAN CARD */

.plan-card {
  margin-bottom: 12px;
}

.plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.plan-pet-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.plan-owner {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.plan-dates {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.plan-date-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-date-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  font-weight: 500;
}

.plan-date-value {
  font-weight: 500;
  color: var(--text);
  font-size: 0.85rem;
}

.plan-days-left {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: auto;
  text-align: right;
}

.days-ok { color: var(--ok); }
.days-warn { color: var(--warn); }
.days-danger { color: var(--danger); }

.plan-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* PROGRESS BAR */

.progress-wrap {
  margin-bottom: 14px;
}

.progress-bar {
  height: 4px;
  background: var(--surface-alt);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
}

.progress-fill-ok { background: var(--accent); }
.progress-fill-warn { background: var(--warn); }
.progress-fill-danger { background: var(--danger); }

/* EMPTY STATE */

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 680px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 100px;
  margin: 0 auto 20px;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-info {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.modal-info-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--text-muted);
}

.modal-info-row span:last-child {
  font-weight: 500;
  color: var(--text);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* SECTION TITLE */

.section-title {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  margin: 20px 0 10px;
}

/* TOAST */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.25s ease;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--accent);
}

.toast.error {
  background: var(--danger);
}

/* SUMMARY STATS */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* LOADING */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* CONFIRM PAGE (renovar) */

.confirm-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.confirm-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  line-height: 1;
}

.confirm-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.confirm-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-details {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 24px;
  text-align: left;
}

.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.confirm-detail-row span:last-child {
  font-weight: 500;
  color: var(--text);
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* PAGE TITLE */

.page-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 24px 0 4px;
}

.page-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* BACK LINK */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  padding: 8px 0;
}

.back-link:hover {
  color: var(--text);
}

/* DIVIDER */

.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* PHONE HINT */

.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
}