/* ══════════════════════════════════════════════════════
   Tate Landscaping Services — Order Portal
   Forest green & gold theme, refined and natural
   ══════════════════════════════════════════════════════ */

:root {
  /* Bryson brand colors */
  --black:      #242424;
  --black-dk:   #1a1a1a;
  --red:        #ed0e0b;
  --red-dk:     #b50b09;
  --red-lt:     #ff3330;
  --red-bg:     #fff2f2;
  --red-bdr:    #fca5a5;
  --red-glow:   rgba(237,14,11,0.15);
  --yellow:     #f6c30a;
  --yellow-dk:  #d4a408;
  --yellow-lt:  #fef9e7;
  --yellow-mid: #fde68a;

  /* Tate accent (used for subtle secondary touches only) */
  --tate-green: #1a3320;

  /* Surfaces — light mode */
  --bg:        #f4f4f4;
  --surface:   #ffffff;
  --surface2:  #f9f9f9;
  --border:    #e0e0e0;
  --border-dk: #cccccc;

  /* Text */
  --text-primary:   #1a1a1a;
  --text-secondary: #444444;
  --text-muted:     #888888;

  /* Semantic */
  --success:    #166534;
  --success-bg: #f0fdf4;
  --success-bdr:#86efac;
  --danger:     #991b1b;
  --danger-bg:  #fef2f2;
  --danger-bdr: #fca5a5;

  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm:  4px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-pill:100px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.16);
  --shadow-red:  0 4px 16px rgba(237,14,11,0.25);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.65;
}
a { color: var(--red-dk); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-dk); }

/* ══════════════════════════════════════
   VIEW MANAGEMENT
══════════════════════════════════════ */
.view { display: none !important; min-height: 100vh; }
.view.active { display: block !important; animation: viewIn .35s cubic-bezier(.22,.68,0,1.1); }
#login-view.active,
#register-view.active,
#forgot-view.active,
#reset-view.active { display: flex !important; }
#app-view.active   { display: flex !important; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   AUTH — split panel layout
══════════════════════════════════════ */
.auth-bg {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left green panel */
.auth-panel-left {
  flex: 0 0 40%;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 2.75rem;
  position: relative;
  overflow: hidden;
}

/* Decorative leaf shapes */
.auth-leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.auth-leaves::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50% 30% 50% 30%;
  background: var(--red);
  opacity: .08;
  transform: rotate(-30deg);
}
.auth-leaves::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -60px;
  width: 280px; height: 280px;
  border-radius: 40% 60% 40% 60%;
  background: var(--yellow);
  opacity: .06;
  transform: rotate(15deg);
}

.auth-logo {
  width: 150px;
  height: auto;
  object-fit: contain;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.3));
  animation: logoSlide .55s cubic-bezier(.22,.68,0,1.2) .1s both;
}
@keyframes logoSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-brand-text { position: relative; z-index: 1; }

.auth-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.05;
  margin-bottom: 1rem;
  animation: slideUp .5s cubic-bezier(.22,.68,0,1.2) .2s both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-rule {
  width: 40px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin-bottom: 1rem;
  animation: ruleGrow .45s ease .3s both;
}
@keyframes ruleGrow {
  from { width: 0; opacity: 0; }
  to   { width: 40px; opacity: 1; }
}

.auth-desc {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  line-height: 1.65;
  font-weight: 300;
  animation: slideUp .5s cubic-bezier(.22,.68,0,1.2) .35s both;
}

.auth-contact {
  position: absolute;
  bottom: 2rem;
  left: 2.75rem;
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.auth-contact a { color: var(--gold-mid); font-weight: 500; }
.auth-contact a:hover { color: var(--yellow); }

/* Right white panel */
.auth-panel-right {
  flex: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  overflow-y: auto;
  animation: panelSlide .45s cubic-bezier(.22,.68,0,1.1) .1s both;
}
@keyframes panelSlide {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.auth-form-wrap { width: 100%; max-width: 420px; }

.auth-form-header { margin-bottom: 1.75rem; }
.auth-form-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .35rem;
}
.auth-form-sub { font-size: 14px; color: var(--text-muted); }
.auth-form-sub a { color: var(--red-dk); font-weight: 500; }
.auth-form-sub a:hover { color: var(--black); }

.form-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1rem;
  font-size: 13px;
  color: var(--text-muted);
}
.form-footer-links a { color: var(--text-secondary); font-weight: 500; }
.form-footer-links a:hover { color: var(--black); }
.link-sep { color: var(--border-dk); }

.helper-text { font-size: 14px; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.6; }

/* ══════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s, background .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
  background: var(--surface);
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ed0e0b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.4rem;
  cursor: pointer;
}
.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-group input[type=date] { color: var(--text-primary); }
.form-group input.autofilled { background: var(--red-bg); color: var(--red-dk); border-color: var(--red-bdr); }
.form-group input.autofilled:focus { background: var(--surface); color: var(--text-primary); border-color: var(--red); }
.readonly-field { background: var(--surface2) !important; color: var(--text-muted) !important; cursor: not-allowed; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
.form-group.span2 { grid-column: span 2; }

.req { color: #dc2626; margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: .3rem; display: block; }
.autofill-note { font-size: 11px; color: var(--text-muted); margin-top: .3rem; display: flex; align-items: center; gap: 4px; }
.autofill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex-shrink: 0; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn-primary {
  width: 100%;
  padding: .85rem 1.5rem;
  background: var(--black);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  letter-spacing: .01em;
}
.btn-primary:hover  { background: #333333; box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
  padding: .6rem 1.25rem;
  background: var(--surface2);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: .875rem;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.btn-secondary:hover { background: var(--red-bg); border-color: var(--red); color: var(--red-dk); box-shadow: var(--shadow-sm); }

.submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  letter-spacing: .01em;
}
.submit-btn:hover    { background: var(--red-lt); box-shadow: var(--shadow-red); }
.submit-btn:active   { transform: scale(.995); }
.submit-btn:disabled { opacity: .55; cursor: not-allowed; }

.submit-row { padding: .5rem 0 3rem; }
.submit-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: .75rem; }

.icon-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  border-radius: var(--radius-sm);
  padding: .4rem .875rem;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.22); }
.icon-btn-ghost { background: transparent; border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.65); }
.icon-btn-ghost:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.9); }

/* ══════════════════════════════════════
   ALERTS
══════════════════════════════════════ */
.alert { padding: .875rem 1rem; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 1rem; line-height: 1.5; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-bdr); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bdr); }

.success-banner {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-bdr);
  border-left: 4px solid var(--success);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 14px;
  font-weight: 500;
  animation: viewIn .3s ease;
}

.notice-box {
  background: var(--yellow-lt);
  border: 1px solid var(--yellow-mid);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  font-size: 12px;
  color: #7a5c08;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════
   APP SHELL
══════════════════════════════════════ */
#app-view { display: none; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--black);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  border-bottom: 3px solid var(--red);
}
.topbar-brand { display: flex; align-items: center; gap: .875rem; min-width: 0; }
.topbar-logo { width: 48px; height: 48px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; padding: 3px; flex-shrink: 0; }
.topbar-text { min-width: 0; }
.topbar-name { display: block; font-family: var(--font-serif); font-size: 15px; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { display: block; font-size: 11px; color: rgba(255,255,255,.55); margin-top: 1px; }
.topbar-actions { display: flex; gap: .4rem; flex-shrink: 0; margin-left: .75rem; }

/* Tab bar */
.tab-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .8rem 1.1rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--red-dk); }
.tab.active { color: var(--red-dk); border-bottom-color: var(--red); }
.tab-icon { font-size: 14px; }
.tab-label { font-size: 13px; }

.tab-content { display: none; padding: 1.25rem; }
.tab-content.active { display: block; animation: viewIn .25s ease; }

/* ══════════════════════════════════════
   CONTENT HEADER
══════════════════════════════════════ */
.content-header { margin-bottom: 1.5rem; }
.content-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.content-sub { font-size: 13px; color: var(--text-muted); display: block; margin-top: .2rem; }

/* ══════════════════════════════════════
   FORM CARDS — step style
══════════════════════════════════════ */
.form-steps { display: flex; flex-direction: column; gap: 0; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.375rem;
  margin-bottom: .875rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, border-color .25s, transform .2s;
  position: relative;
}
.form-card:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--border-dk);
  transform: translateY(-1px);
}

/* Step connector line */
.form-card::after {
  content: '';
  position: absolute;
  bottom: -0.875rem;
  left: 2.125rem;
  width: 2px;
  height: .875rem;
  background: var(--border);
}
.form-card:last-child::after { display: none; }

.form-card-header {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  margin-bottom: 1.125rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--border);
}
.form-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.form-card-sub { font-size: 12px; color: var(--text-muted); margin-top: .2rem; line-height: 1.4; }

/* Step badge */
.step-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-sans);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: background .2s, transform .2s;
}
.form-card:focus-within .step-badge { background: var(--red); color: #fff; transform: scale(1.08); }
.step-badge-sm { width: 24px; height: 24px; font-size: 11px; }

/* Conditional blocks */
.conditional-block { display: none; margin-top: .75rem; padding: 1rem; background: var(--surface2); border-radius: var(--radius-md); border: 1px solid var(--border); }
.conditional-block.visible { display: block; animation: viewIn .2s ease; }

/* ══════════════════════════════════════
   ORDER HISTORY CARDS
══════════════════════════════════════ */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-left-color .2s;
  border-left: 4px solid var(--red);
}
.order-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-left-color: var(--yellow-dk); }
.order-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .5rem; }
.order-number { font-family: var(--font-serif); font-size: 13px; font-weight: 700; color: var(--red-dk); }
.order-material { font-size: 15px; color: var(--text-primary); margin-bottom: .25rem; font-weight: 600; }
.order-detail { font-size: 13px; color: var(--text-muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: .22rem .65rem; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.badge-pending   { background: var(--yellow-lt);    color: #7a5c08;        border: 1px solid var(--yellow-mid); }
.badge-confirmed { background: #eff6ff;            color: #1d4ed8;        border: 1px solid #bfdbfe; }
.badge-delivered { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bdr); }
.badge-cancelled { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-bdr); }

/* ══════════════════════════════════════
   LOADING / EMPTY
══════════════════════════════════════ */
.loading-state, .empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.loading-state p, .empty-state p { font-size: 14px; margin-top: .875rem; line-height: 1.6; }
.empty-icon { font-size: 2.5rem; margin-bottom: .5rem; opacity: .4; display: block; }

/* ══════════════════════════════════════
   SPINNERS
══════════════════════════════════════ */
.spinner    { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; display: inline-block; }
.spinner-lg { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin .65s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 720px) {
  .auth-bg { flex-direction: column; }
  .auth-panel-left { flex: none; padding: 2rem 1.5rem 1.5rem; min-height: unset; }
  .auth-logo { width: 110px; margin-bottom: 1.25rem; }
  .auth-title { font-size: 2rem; }
  .auth-contact { position: static; margin-top: 1.25rem; }
  .auth-panel-right { padding: 1.75rem 1.25rem; align-items: flex-start; }
}
@media (max-width: 560px) {
  .form-row, .form-row.three-col { grid-template-columns: 1fr; }
  .form-group.span2 { grid-column: span 1; }
  .topbar { padding: .6rem .875rem; }
  .topbar-name { font-size: 13px; }
  .topbar-logo { width: 38px; height: 38px; }
}

/* ══════════════════════════════════════
   DUAL LOGO — AUTH & TOPBAR
══════════════════════════════════════ */
.auth-logos-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
  animation: logoSlide .55s cubic-bezier(.22,.68,0,1.2) .1s both;
}
.auth-logo-bryson {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}
.auth-logo-sep {
  width: 1px;
  height: 56px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.auth-logo-tate {
  width: 100px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

.topbar-logos {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.topbar-logo-bryson {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.topbar-logo-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.topbar-logo-tate {
  width: 52px;
  height: 38px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
