/* === FIT FOOD Order Form Styles === */
:root {
  --ff-green:      #1a5c2a;
  --ff-green-lt:   #2d7a40;
  --ff-green-bg:   #eef6f0;
  --ff-border:     #d0e4d5;
  --ff-text:       #2c2c2c;
  --ff-muted:      #666;
  --ff-white:      #ffffff;
  --ff-row-even:   #f7fbf8;
  --ff-shadow:     0 2px 16px rgba(26,92,42,.10);
}

/* ---- Wrap ---- */
#fitfood-wrap { font-family: Arial, Helvetica, sans-serif; color: var(--ff-text); font-size: 14px; max-width: 1200px; margin: 0 auto; }

/* ---- Login ---- */
#ff-login-panel { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 40px 20px; }
.ff-login-box   { background: var(--ff-white); border-radius: 12px; box-shadow: var(--ff-shadow); padding: 40px 48px; max-width: 420px; width: 100%; text-align: center; border: 1px solid var(--ff-border); }
.ff-logo        { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 24px; }
.ff-logo-leaf   { font-size: 40px; }
.ff-logo h1     { margin: 0; font-size: 24px; color: var(--ff-green); line-height: 1; }
.ff-logo p      { margin: 2px 0 0; font-size: 13px; color: var(--ff-muted); }
.ff-login-box h2 { font-size: 16px; color: var(--ff-green); margin: 0 0 6px; }
.ff-login-hint   { font-size: 13px; color: var(--ff-muted); margin: 0 0 20px; }
.ff-field        { margin-bottom: 16px; }
.ff-field input  { width: 100%; padding: 12px 16px; border: 2px solid var(--ff-border); border-radius: 8px; font-size: 16px; text-align: center; letter-spacing: 2px; box-sizing: border-box; transition: border-color .2s; }
.ff-field input:focus { outline: none; border-color: var(--ff-green); }

/* ---- Buttons ---- */
.ff-btn        { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: 8px; font-size: 14px; font-weight: bold; cursor: pointer; border: 2px solid transparent; transition: all .2s; text-decoration: none; }
.ff-btn-green  { background: var(--ff-green); color: var(--ff-white); border-color: var(--ff-green); width: 100%; justify-content: center; }
.ff-btn-green:hover { background: var(--ff-green-lt); }
.ff-btn-outline{ background: var(--ff-white); color: var(--ff-green); border-color: var(--ff-green); }
.ff-btn-outline:hover { background: var(--ff-green-bg); }

/* ---- Messages ---- */
.ff-msg         { padding: 10px 14px; border-radius: 6px; margin-top: 12px; font-size: 13px; }
.ff-msg-error   { background: #fdecea; color: #b71c1c; border: 1px solid #f1998e; }
.ff-msg-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }

/* ---- Order Header ---- */
.ff-order-header      { background: var(--ff-green); color: var(--ff-white); padding: 18px 24px; border-radius: 10px 10px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ff-order-header-logo { display: flex; align-items: center; gap: 12px; }
.ff-order-header-logo span { font-size: 28px; }
.ff-order-header-logo strong { display: block; font-size: 18px; }
.ff-order-header-logo span.tag { font-size: 12px; opacity: .8; }
.ff-order-meta        { display: flex; gap: 28px; }
.ff-order-meta > div  { display: flex; flex-direction: column; align-items: flex-end; }
.ff-order-meta label  { font-size: 11px; opacity: .75; text-transform: uppercase; }
.ff-order-num         { font-size: 20px; font-weight: bold; letter-spacing: 1px; }
.ff-order-date        { font-size: 15px; font-weight: bold; }

/* ---- Client Section ---- */
.ff-client-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px; background: var(--ff-green-bg); border: 1px solid var(--ff-border); border-top: none; }
.ff-address-block  { background: var(--ff-white); border-radius: 8px; padding: 16px 18px; border: 1px solid var(--ff-border); }
.ff-address-block h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; color: var(--ff-green); border-bottom: 1px solid var(--ff-border); padding-bottom: 6px; }
.ff-address-content { font-size: 13px; line-height: 1.7; }
.ff-address-content strong { display: block; font-size: 14px; }

/* ---- Products Section ---- */
.ff-products-section { background: var(--ff-white); border: 1px solid var(--ff-border); border-top: none; padding: 20px; }
.ff-section-title    { font-size: 16px; color: var(--ff-green); margin: 0 0 14px; }
.ff-table-wrap       { overflow-x: auto; }

#ff-products-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#ff-products-table th { background: var(--ff-green); color: var(--ff-white); padding: 10px 8px; text-align: center; font-size: 12px; white-space: nowrap; }
#ff-products-table td { padding: 8px 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
#ff-products-table tbody tr:nth-child(even) td { background: var(--ff-row-even); }
#ff-products-table tbody tr:hover td { background: #dff0e4; }
#ff-products-table .ff-nl { display: block; font-size: 10px; font-style: italic; opacity: .75; font-weight: normal; }
.ff-td-ref  { font-weight: bold; color: var(--ff-green); white-space: nowrap; }
.ff-td-name { font-weight: bold; }
.ff-td-nl   { font-size: 11px; color: var(--ff-muted); font-style: italic; }
.ff-td-right { text-align: right !important; }
.ff-td-center{ text-align: center !important; }
.ff-moq-input { width: 70px; padding: 6px 8px; border: 2px solid var(--ff-border); border-radius: 6px; font-size: 14px; text-align: center; font-weight: bold; transition: border-color .2s; }
.ff-moq-input:focus  { outline: none; border-color: var(--ff-green); }
.ff-moq-input.ff-filled { border-color: var(--ff-green); background: #e8f5e9; }
.ff-qty-uv   { font-weight: bold; color: var(--ff-green); }
.ff-total-ht-cell { font-weight: bold; color: #1a1a1a; }

/* Totals row */
.ff-totals-row td          { background: var(--ff-green-bg) !important; border-top: 2px solid var(--ff-green); font-weight: bold; font-size: 13px; }
.ff-totals-label           { text-align: right; color: var(--ff-green); text-transform: uppercase; }

/* Summary */
.ff-summary           { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ff-summary-row       { display: flex; align-items: center; gap: 24px; }
.ff-summary-label     { font-size: 14px; color: var(--ff-muted); }
.ff-summary-val       { font-size: 15px; font-weight: bold; min-width: 110px; text-align: right; }
.ff-grand-total-row .ff-summary-label { font-size: 16px; font-weight: bold; color: var(--ff-green); }
.ff-grand-total-row .ff-summary-val   { font-size: 20px; color: var(--ff-green); }
.ff-shipping-note     { font-size: 12px; color: var(--ff-muted); font-style: italic; margin-top: 4px; }
.ff-shipping-free     { color: #2e7d32 !important; font-weight: bold; }

/* Actions */
.ff-actions { background: var(--ff-green-bg); border: 1px solid var(--ff-border); border-top: none; padding: 18px 20px; border-radius: 0 0 10px 10px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ff-actions .ff-btn-green  { flex: 1; min-width: 200px; font-size: 15px; padding: 14px 20px; }
.ff-actions .ff-btn-outline { min-width: 140px; }

/* Confirmation */
.ff-confirm-header  { display: flex; align-items: center; gap: 16px; background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 10px; padding: 20px 24px; margin-bottom: 24px; }
.ff-confirm-icon    { font-size: 36px; }
.ff-confirm-header h2 { margin: 0; color: #1b5e20; }
.ff-confirm-header p  { margin: 4px 0 0; color: #388e3c; font-size: 13px; }
.ff-confirm-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.ff-confirm-actions .ff-btn { min-width: 200px; justify-content: center; }

/* Printable receipt */
#ff-printable { border: 1px solid var(--ff-border); border-radius: 8px; overflow: hidden; }
.ff-print-header { background: var(--ff-green); color: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.ff-print-header h2 { margin: 0; font-size: 18px; }
.ff-print-header .ff-print-meta { text-align: right; font-size: 13px; }
.ff-print-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 24px; background: var(--ff-green-bg); }
.ff-print-addr-block { background: #fff; border-radius: 6px; padding: 12px 14px; border: 1px solid var(--ff-border); font-size: 12px; line-height: 1.7; }
.ff-print-addr-block h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--ff-green); }
.ff-print-table-wrap { padding: 16px 24px; overflow-x: auto; }
.ff-print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ff-print-table th { background: var(--ff-green); color: #fff; padding: 8px 6px; font-size: 11px; }
.ff-print-table td { padding: 6px; border-bottom: 1px solid #eee; }
.ff-print-table tbody tr:nth-child(even) td { background: #f7fbf8; }
.ff-print-totals { padding: 14px 24px; border-top: 2px solid var(--ff-border); display: flex; justify-content: flex-end; }
.ff-print-totals-box { font-size: 13px; }
.ff-print-totals-box .ff-pt-row { display: flex; gap: 40px; justify-content: space-between; padding: 4px 0; }
.ff-print-totals-box .ff-pt-grand { font-weight: bold; font-size: 16px; color: var(--ff-green); border-top: 1px solid var(--ff-border); padding-top: 8px; margin-top: 4px; }

/* Loading spinner */
.ff-spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: ff-spin .7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes ff-spin { to { transform: rotate(360deg); } }

/* Print media */
@media print {
  #ff-login-panel, #ff-order-panel, .ff-confirm-header, .ff-confirm-actions { display: none !important; }
  #ff-confirm-panel { display: block !important; }
  #ff-printable { border: none; }
  .ff-print-header { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ff-print-table th { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Responsive */
@media (max-width: 768px) {
  .ff-client-section { grid-template-columns: 1fr; }
  .ff-order-meta { flex-direction: column; align-items: flex-end; }
  .ff-print-addresses { grid-template-columns: 1fr; }
  .ff-actions { flex-direction: column; }
}
