/* Ryan's Home Solutions — design tokens & shared components */

:root {
  --color-primary: #2d4a7a;
  --color-primary-dark: #1e3558;
  --color-accent: #4a9b6e;
  --color-lime: #c5e84a;
  --color-lime-dark: #b0cf36;
  --color-text: #1f2937;
  --color-muted: #5c6570;
  --color-border: #d8dee6;
  --color-surface: #ffffff;
  --color-surface-alt: #f3f6fa;
  --font-heading: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-btn: 0 4px 14px rgba(45, 74, 122, 0.22);
  --header-height: 108px;
  --rhs-overlay: rgba(30, 53, 88, 0.55);
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-surface);
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary,
.btn-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover,
.btn-hero:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 74, 122, 0.32);
  opacity: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-block;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  margin-top: 16px;
}

.btn-secondary:hover {
  text-decoration: underline;
}

.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-outline:hover {
  background: var(--color-surface-alt);
}

.add-btn {
  background: var(--color-lime);
  color: var(--color-primary-dark);
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  justify-self: end;
  box-shadow: 0 2px 8px rgba(176, 207, 54, 0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}

.add-btn:hover {
  background: var(--color-lime-dark);
  transform: translateY(-1px);
  opacity: 1;
}

.remove-btn {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
}

.remove-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
}

.slot-btn {
  background: #fff;
  border: 2px solid var(--color-border);
  color: var(--color-text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.slot-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
}

.slot-btn.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ── Cart toast ── */

.cart-toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.cart-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(30, 53, 88, 0.18);
  font-family: var(--font-body);
  animation: cart-toast-in 0.28s ease;
}

.cart-toast.is-leaving {
  animation: cart-toast-out 0.22s ease forwards;
}

.cart-toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

.cart-toast-body {
  flex: 1;
  min-width: 0;
}

.cart-toast-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.cart-toast-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.cart-toast-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.cart-toast-link:hover {
  text-decoration: underline;
}

@keyframes cart-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cart-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 600px) {
  .cart-toast-host {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

/* ── Other Tasks modal ── */

body.cart-task-modal-open {
  overflow: hidden;
}

.cart-task-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.cart-task-modal[hidden] {
  display: none;
}

.cart-task-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 53, 88, 0.55);
}

.cart-task-modal-card {
  position: relative;
  width: min(100%, 520px);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 16px 48px rgba(30, 53, 88, 0.22);
}

.cart-task-modal-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-primary);
}

.cart-task-modal-card p {
  margin: 0 0 16px;
  color: var(--color-muted);
  line-height: 1.5;
}

.cart-add-modal-service {
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--color-primary);
}

.cart-task-modal-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.cart-task-modal-card textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  resize: vertical;
}

.cart-task-modal-card input[type="url"],
.cart-task-modal-card input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.cart-task-modal-card input[type="url"] {
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.cart-task-modal-card input[type="url"]:focus {
  outline: none;
  border-color: var(--color-primary);
}

.cart-optional-label {
  font-weight: 400;
  color: var(--color-muted);
}

.cart-file-help {
  margin: -4px 0 12px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.cart-reference-preview {
  margin-bottom: 12px;
}

.cart-task-modal-card textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.cart-task-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.cart-task-modal-card .status.error {
  margin-top: 12px;
}

/* ── Site footer ── */

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 16px 32px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  max-width: 640px;
  padding: 0 12px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-muted);
}
