/* =============================================
   FELIZE BOTANICA — BloomCare Support Portal
   Brand Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  /* --- Brand Palette --- */
  --isabelline:    #F8F6F2;
  --bone:          #E0D5C5;
  --bone-mid:      #CFC4B2;
  --spring-green:  #157145;
  --teal:          #305757;
  --charcoal:      #353431;
  --forest:        #09341F;
  --white:         #FFFFFF;

  /* --- Semantic --- */
  --bg:            var(--isabelline);
  --surface:       var(--white);
  --border:        var(--bone);
  --border-mid:    var(--bone-mid);

  /* --- Text --- */
  --text-dark:     #353431;
  --text-mid:      rgba(53,52,49,0.62);
  --text-light:    rgba(53,52,49,0.42);
  --text-muted:    rgba(53,52,49,0.30);

  /* --- Status (earthy, muted) --- */
  --status-open:          #E6F0DC;
  --status-open-text:     #2D5E18;
  --status-progress:      #DEE9F5;
  --status-progress-text: #1A4F8A;
  --status-resolved:      #ECEAE4;
  --status-resolved-text: #5A5850;
  --status-closed:        #EDEAE4;
  --status-closed-text:   #807D78;

  /* --- Priority (muted) --- */
  --priority-low:          #E6F0DC;
  --priority-low-text:     #2D5E18;
  --priority-med:          #F5EDD8;
  --priority-med-text:     #7A4C10;
  --priority-high:         #F5E8D8;
  --priority-high-text:    #7A3D10;
  --priority-urgent:       #F2E0E0;
  --priority-urgent-text:  #7A1E1E;

  /* --- Semantic UI colors --- */
  --error:   #8B2020;
  --success: var(--spring-green);

  /* --- Spacing --- */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  10px;

  /* --- Shadow (very restrained) --- */
  --shadow-sm:  0 1px 3px rgba(53,52,49,0.06);
  --shadow-md:  0 2px 8px rgba(53,52,49,0.08);

  /* --- Typography --- */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   LAYOUT
   ============================================= */

.page-wrapper {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.page-wrapper--wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* =============================================
   HEADER / NAV
   ============================================= */

.site-header {
  background: var(--charcoal);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-leaf { width: 28px; height: 28px; }

.logo-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(248,246,242,0.75);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.logo-text span {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: rgba(248,246,242,0.30);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  font-size: 12px;
  color: rgba(248,246,242,0.42);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* =============================================
   BUTTONS

   Three levels:
   1. btn-primary  — Deep Forest fill. Main CTA.
   2. btn-outline  — Transparent + Charcoal border. Standalone secondary actions.
   3. btn-ghost    — Underline only. Inline nav actions in the header.
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  background: none;
}

.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* 1. Primary — Deep Forest fill */
.btn-primary {
  background: var(--forest);
  color: var(--white);
}
.btn-primary:hover { background: var(--spring-green); }

/* 2. Outline — standalone secondary, light backgrounds */
.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 0.5px solid var(--charcoal);
}
.btn-outline:hover {
  background: var(--isabelline);
}

/* 3. Ghost — underline style, used in header (dark background) */
.btn-ghost {
  background: transparent;
  color: rgba(248,246,242,0.55);
  border: none;
  padding-left: 0;
  padding-right: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.btn-ghost:hover {
  color: rgba(248,246,242,0.88);
  text-decoration-color: rgba(248,246,242,0.30);
}

/* Sizes */
.btn-sm  { padding: 6px 12px; font-size: 10px; }
.btn-lg  { padding: 11px 22px; font-size: 11.5px; }
.btn-full { width: 100%; justify-content: center; }

/* =============================================
   PAGE HERO
   ============================================= */

.page-hero {
  padding: 44px 0 32px;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 500;
  color: var(--forest);
  line-height: 1.25;
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 13px;
  color: var(--text-mid);
  max-width: 520px;
  line-height: 1.75;
}

/* =============================================
   CARDS
   ============================================= */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--border);
}

.card-green {
  background: rgba(9,52,31,0.03);
  border-color: var(--bone);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--forest);
  margin-bottom: 4px;
}

.card-body {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-label .required { color: var(--error); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(48,87,87,0.10);
}

.form-input.input-green {
  background: rgba(9,52,31,0.02);
  border-color: var(--border);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23353431' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* =============================================
   TICKET CARD
   ============================================= */

.ticket-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  border: 0.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.ticket-card:hover {
  border-color: var(--bone-mid);
  box-shadow: var(--shadow-sm);
}

.ticket-info h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.ticket-meta {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ticket-id {
  font-family: monospace;
  font-size: 10.5px;
  background: var(--isabelline);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-mid);
}

.ticket-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* =============================================
   STATUS / PRIORITY BADGES
   ============================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.badge-open      { background: var(--status-open);     color: var(--status-open-text); }
.badge-progress  { background: var(--status-progress);  color: var(--status-progress-text); }
.badge-resolved  { background: var(--status-resolved);  color: var(--status-resolved-text); }
.badge-closed    { background: var(--status-closed);    color: var(--status-closed-text); }

.badge-low    { background: var(--priority-low);    color: var(--priority-low-text); }
.badge-medium { background: var(--priority-med);    color: var(--priority-med-text); }
.badge-high   { background: var(--priority-high);   color: var(--priority-high-text); }
.badge-urgent { background: var(--priority-urgent); color: var(--priority-urgent-text); }

/* =============================================
   EMPTY STATE
   ============================================= */

.empty-state {
  text-align: center;
  padding: 56px 24px;
}

.empty-state svg { margin-bottom: 14px; opacity: 0.25; }

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.empty-state p { font-size: 12.5px; color: var(--text-light); }

/* =============================================
   LOADING / SPINNER
   ============================================= */

.spinner {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--bone);
  border-top-color: var(--charcoal);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 40px auto;
}

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

.loading-state { text-align: center; padding: 40px; }

/* =============================================
   ALERT / NOTICE
   ============================================= */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.55;
  border: 0.5px solid transparent;
}

.alert-error   { background: #F5EAEA; color: var(--error); border-color: #DDBDBD; }
.alert-success { background: var(--status-open); color: var(--status-open-text); border-color: #BDDDB0; }
.alert-info    { background: rgba(48,87,87,0.05); color: var(--teal); border-color: var(--bone); }

/* =============================================
   QUICK LINKS GRID
   ============================================= */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.quick-link-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-link-card:hover {
  border-color: var(--bone-mid);
  box-shadow: var(--shadow-sm);
}

.quick-link-icon { font-size: 18px; }

.quick-link-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--charcoal);
}

.quick-link-desc {
  font-size: 11.5px;
  color: var(--text-light);
  line-height: 1.5;
}

/* =============================================
   TICKET DETAIL
   ============================================= */

.ticket-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ticket-detail-id {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}

.ticket-detail-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--forest);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-field label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}

.detail-field p {
  font-size: 13px;
  color: var(--text-dark);
}

/* =============================================
   SECTION HEADING
   ============================================= */

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =============================================
   DIVIDER
   ============================================= */

.divider {
  height: 0.5px;
  background: var(--border);
  margin: 24px 0;
}

/* =============================================
   SUCCESS SCREEN
   ============================================= */

.success-screen {
  text-align: center;
  padding: 56px 32px;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: rgba(9,52,31,0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 26px;
}

.success-screen h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--forest);
  margin-bottom: 8px;
}

.success-screen p {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.ticket-id-display {
  display: inline-block;
  font-family: monospace;
  font-size: 17px;
  font-weight: 500;
  color: var(--charcoal);
  background: var(--isabelline);
  border: 0.5px dashed var(--bone-mid);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  margin: 18px 0;
  letter-spacing: 0.08em;
}

/* =============================================
   PUBLIC LANDING — HERO
   ============================================= */

.landing-hero {
  padding: 64px 0 48px;
  max-width: 580px;
}

.landing-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  color: var(--forest);
  line-height: 1.22;
  margin-bottom: 14px;
}

.landing-hero h1 em {
  font-style: italic;
  color: var(--spring-green);
}

.landing-hero p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 28px;
}

.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .page-wrapper, .page-wrapper--wide { padding: 0 16px 56px; }
  .card { padding: 18px; }
  .ticket-card { flex-direction: column; }
  .ticket-badges { align-self: flex-start; }
  .landing-hero { padding: 40px 0 32px; }
}

/* =============================================
   MISC
   ============================================= */

[data-netlify-identity-button] { display: none !important; }
