/* Gutter Forms Pro - Frontend Styles */

:root {
  --bg-app: #eef2f6;       
  --sheet-shadow: 0 10px 40px rgba(0,0,0,0.08);
  --accent: #0066cc;       
  --text-dark: #1a1a1a;
  --border-radius: 12px;
  --glass: rgba(255, 255, 255, 0.85);
}

.gfp-wrapper {
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-app);
  padding: 20px;
  border-radius: var(--border-radius);
  -webkit-font-smoothing: antialiased;
}

.gfp-stage {
  transform-origin: top center;
  will-change: transform;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.gfp-sheet {
  width: 100%;
  max-width: 920px;
  background: #fff;
  padding: 45px;
  box-sizing: border-box;
  box-shadow: var(--sheet-shadow);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  min-height: 1100px;
}

/* Header */
.gfp-header {
  border-bottom: 3px solid #000;
  padding-bottom: 15px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.gfp-brand-group {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.gfp-brand-logo {
  max-width: 80px;
  height: auto;
}

.gfp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.gfp-brand-name {
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
  color: #000;
  letter-spacing: -0.5px;
}

.gfp-brand-sub {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
  margin-top: 4px;
}

.gfp-meta {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  color: #555;
}

.gfp-meta-title {
  font-size: 16px;
  font-weight: 900;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Drawing Area */
.gfp-drawing-area {
  border: 2px solid #ddd;
  border-radius: 12px;
  width: 100%;
  height: 260px;
  background-image: radial-gradient(#ccc 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
  margin-bottom: 25px;
  overflow: hidden;
  touch-action: none;
  background-color: #fdfdfd;
}

.gfp-drawing-area canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Form Inputs */
.gfp-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.gfp-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #444;
}

.gfp-wrapper input[type="text"],
.gfp-wrapper input[type="number"],
.gfp-wrapper input[type="tel"],
.gfp-wrapper input[type="email"] {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fcfcfc;
  outline: none;
  padding: 8px 10px;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.gfp-wrapper input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.gfp-wrapper input.clean-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: none;
}

.gfp-wrapper input.clean-input:focus {
  box-shadow: none;
  border-bottom-color: var(--accent);
}

.gfp-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #555;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  background: #fff;
  transition: all 0.1s;
  color: #fff;
}

.gfp-checkbox:active {
  transform: scale(0.9);
}

.gfp-checkbox.checked {
  background: #222;
  border-color: #222;
}

.gfp-price-display {
  font-weight: 800;
  min-width: 70px;
  text-align: right;
  font-size: 14px;
  color: #222;
}

/* Financial Box */
.gfp-grand-box {
  background: #f8f9fb;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  text-align: right;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.gfp-fin-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.gfp-fin-val {
  min-width: 80px;
  text-align: right;
  font-weight: 700;
  color: #333;
}

.gfp-grand-total-row {
  margin-top: 12px;
  border-top: 1px solid #e0e0e0;
  padding-top: 12px;
  margin-bottom: 12px;
}

.gfp-grand-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  font-weight: 700;
  margin-bottom: 2px;
}

.gfp-grand-value {
  font-size: 38px;
  font-weight: 900;
  color: #111;
  line-height: 1;
  letter-spacing: -1.5px;
}

.gfp-deposit-row {
  background: #eef2ff;
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.gfp-balance-row {
  background: #111;
  padding: 12px 15px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

/* Notes */
.gfp-notes-box {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fcfcfc;
  padding: 12px;
  margin-bottom: 15px;
  flex-grow: 1;
  min-height: 80px;
  display: flex;
}

.gfp-notes-box textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  outline: none;
  line-height: 1.5;
  color: #333;
}

/* Photos */
.gfp-photo-section {
  margin-top: 10px;
}

.gfp-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.gfp-photo-item {
  position: relative;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  height: 160px;
  background: #eee;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.gfp-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gfp-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

/* Legal */
.gfp-legal-section {
  margin-top: auto;
  border-top: 2px solid #eee;
  padding-top: 20px;
}

.gfp-legal-text {
  font-size: 10px;
  color: #777;
  text-align: justify;
  line-height: 1.4;
  margin-bottom: 20px;
}

.gfp-legal-text strong {
  color: #333;
}

/* Signature Pad */
.gfp-sig-pad-wrap {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  border-bottom: 2px solid #ccc;
  height: 120px;
  width: 100%;
  background: #fff;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.gfp-sig-pad-wrap canvas {
  cursor: crosshair;
}

.gfp-sig-clear {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 4px 10px;
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  z-index: 10;
}

/* Submit Button */
.gfp-submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gfp-submit-btn:hover {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.gfp-submit-btn:active {
  transform: translateY(0);
}

.gfp-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Success Message */
.gfp-success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
  font-weight: 600;
}

.gfp-error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .gfp-sheet {
    padding: 25px;
  }
  
  .gfp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .gfp-meta {
    text-align: left;
  }
  
  .gfp-photo-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FLOATING TOOLBAR - NEW FEATURE
   ============================================ */

.gfp-tools {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 16px;
  border-radius: 50px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 2px 10px rgba(0,0,0,0.05);
  z-index: 1000;
  border: 1px solid rgba(255,255,255,0.6);
  overflow-x: auto;
  max-width: 95vw;
}

.gfp-tools button {
  padding: 12px 20px;
  border-radius: 24px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.gfp-tools button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gfp-tools button:active {
  transform: scale(0.95);
}

.gfp-tools .gfp-btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gfp-tools .gfp-btn-dark {
  background: #222;
  color: #fff;
}

/* ============================================
   MOBILE HAMBURGER MENU - NEW FEATURE
   ============================================ */

.gfp-hamburger {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 1200;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 0;
  background: rgba(0,0,0,0.88);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  display: none;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform 0.2s;
}

.gfp-hamburger:active {
  transform: scale(0.9);
}

.gfp-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1201;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(5px);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gfp-mobile-menu-content {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border: 2px solid #000;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: slideUp 0.3s ease-out;
}

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

.gfp-mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.gfp-mobile-menu-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #000;
}

.gfp-mobile-menu-header button {
  background: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 8px 15px;
  font-weight: 900;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.gfp-mobile-menu-header button:hover {
  background: #e0e0e0;
}

.gfp-mobile-menu-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gfp-mobile-menu-buttons button {
  border-radius: 14px;
  padding: 14px 12px;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid #ddd;
  background: #f6f6f6;
  cursor: pointer;
  transition: all 0.2s;
}

.gfp-mobile-menu-buttons button:active {
  transform: scale(0.95);
}

.gfp-mobile-menu-buttons button.primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.gfp-mobile-menu-buttons button.dark {
  background: #000;
  color: #fff;
  border: 0;
}

/* ============================================
   PRINT STYLES - CRITICAL FOR CUSTOMER COPIES
   ============================================ */

@media print {
  body {
    padding: 0;
    background: #fff;
  }
  
  .gfp-wrapper {
    background: #fff;
    padding: 0;
    margin: 0;
  }
  
  .gfp-stage {
    padding-bottom: 0;
  }
  
  .gfp-sheet {
    box-shadow: none;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0.4in;
    border: none;
    min-height: auto;
  }
  
  /* Hide all UI controls */
  .gfp-tools,
  .gfp-hamburger,
  .gfp-mobile-menu,
  .gfp-submit-btn,
  .gfp-photo-remove,
  .gfp-sig-clear,
  .gfp-success-message,
  .gfp-error-message {
    display: none !important;
  }
  
  /* Clean up inputs for print */
  .gfp-wrapper input[type="text"],
  .gfp-wrapper input[type="number"],
  .gfp-wrapper input[type="tel"],
  .gfp-wrapper input[type="email"] {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    border-radius: 0 !important;
    padding-left: 0 !important;
    box-shadow: none !important;
  }
  
  .gfp-wrapper textarea {
    background: transparent !important;
    border: 1px solid #ddd !important;
  }
  
  /* Make checkboxes print-friendly */
  .gfp-checkbox {
    border-color: #000 !important;
    background: #fff !important;
  }
  
  .gfp-checkbox.checked {
    background: #000 !important;
  }
  
  /* Financial box for print */
  .gfp-grand-box {
    background: transparent !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
  }
  
  .gfp-deposit-row,
  .gfp-balance-row {
    background: #eee !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid #000 !important;
  }
  
  /* Drawing and signature areas */
  .gfp-drawing-area,
  .gfp-sig-pad-wrap {
    border-color: #000 !important;
  }
  
  /* Page breaks */
  .gfp-legal-section {
    page-break-inside: avoid;
  }
  
  .gfp-grand-box {
    page-break-inside: avoid;
  }
}

/* ============================================
   RESPONSIVE - MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 720px) {
  /* Hide desktop toolbar, show hamburger */
  .gfp-tools {
    display: none !important;
  }
  
  .gfp-hamburger {
    display: block;
  }
  
  .gfp-sheet {
    padding: 25px;
  }
  
  .gfp-stage {
    padding-bottom: 80px;
  }
  
  .gfp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .gfp-meta {
    text-align: left;
  }
  
  .gfp-main-grid {
    grid-template-columns: 1fr;
  }
  
  .gfp-photo-grid {
    grid-template-columns: 1fr;
  }
  
  .gfp-mobile-menu-buttons {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 860px) {
  .gfp-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 50px;
  }
  
  .gfp-sheet {
    padding: 50px;
    border-radius: 4px;
  }
  
  .gfp-wrapper {
    padding: 40px;
    background: #c2c9d6;
  }
  
  .gfp-stage {
    padding-bottom: 0;
  }
  
  .gfp-photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
