@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color Variables */
:root {
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --brand-primary: #8B0000;      /* Dark Crimson Red from Logo */
  --brand-hover: #b30000;
  --brand-light: #fdf2f2;
  
  --success-primary: #10b981;    /* Emerald Green */
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.04), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.03), 0 8px 10px -6px rgb(0 0 0 / 0.03);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Base Container */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Premium Card Layout */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 32px 24px;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), #ff4d4d);
  opacity: 0.8;
}

/* Brand Header */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 8px;
}

.brand-logo-img {
  width: 170px;
  height: auto;
  user-select: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.02));
}

/* Typography styles */
h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 15px;
  color: var(--text-primary);
  background-color: #fff;
  transition: all 0.2s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* Preset Buttons for Shirts */
.preset-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.preset-btn {
  background-color: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background-color: var(--bg-main);
  border-color: var(--text-secondary);
}

.preset-btn.active {
  border-color: var(--brand-primary);
  background-color: var(--brand-light);
  color: var(--brand-primary);
}

.preset-btn .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.preset-btn .dot-yellow {
  background-color: #fbbf24;
  border: 1px solid #d97706;
}

.preset-btn .dot-blue {
  background-color: #2563eb;
  border: 1px solid #1d4ed8;
}

/* Premium Buttons */
.btn-primary {
  width: 100%;
  background-color: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(139, 0, 0, 0.2), 0 2px 4px -2px rgba(139, 0, 0, 0.2);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(139, 0, 0, 0.3), 0 4px 6px -2px rgba(139, 0, 0, 0.2);
}

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

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Generated Link Area */
.result-area {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: none;
  animation: slideUp 0.3s ease;
}

.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 12px;
  margin-top: 8px;
  overflow: hidden;
}

.copy-input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--text-secondary);
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Client View Specifics */
.order-summary {
  background-color: var(--bg-main);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.summary-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-value {
  color: var(--text-primary);
  font-weight: 600;
}

.summary-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-primary);
}

/* QR Code & Pix Code */
.pix-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  animation: fadeIn 0.4s ease;
}

.qrcode-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.qrcode-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pix-instructions {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
  max-width: 320px;
}

.copypaste-area {
  width: 100%;
  margin-bottom: 20px;
}

.copypaste-code {
  width: 100%;
  height: 60px;
  background-color: #f1f5f9;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-secondary);
  resize: none;
  outline: none;
  word-break: break-all;
  margin-bottom: 8px;
}

/* Status Indicator */
.status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
  margin: 0 auto;
}

.status-pending {
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-badge .dot-pulse {
  animation: pulse-dot 1.5s infinite;
}

/* Success State View */
.success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-wrapper {
  width: 72px;
  height: 72px;
  background-color: var(--success-bg);
  border: 2px solid var(--success-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--success-primary);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.success-icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck 0.6s ease forwards 0.2s;
}

/* Security badges footer */
.security-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  opacity: 0.7;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.security-badge svg {
  width: 14px;
  height: 14px;
  color: #475569;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mock Simulation Button (Admin/Testing utility) */
.mock-simulate-btn {
  margin-top: 16px;
  background-color: #fafaf9;
  color: #78716c;
  border: 1px dashed #d6d3d1;
  border-radius: var(--radius-md);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}

.mock-simulate-btn:hover {
  background-color: #f5f5f4;
  color: #44403c;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Pulse loader for QR code generation */
.pulse-loader {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

/* Mobile Responsiveness Rules */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  .app-container {
    gap: 16px;
  }
  .card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }
  h1 {
    font-size: 20px;
  }
  .brand-logo-img {
    width: 140px;
  }
  .qrcode-wrapper {
    width: 190px;
    height: 190px;
    padding: 6px;
    margin-bottom: 16px;
  }
  .pix-instructions {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .copypaste-code {
    font-size: 10px;
    height: 50px;
    padding: 8px 10px;
  }
  .btn-primary {
    padding: 12px;
    font-size: 14px;
  }
  .order-summary {
    padding: 12px;
    margin-bottom: 16px;
    gap: 8px;
  }
  .summary-row {
    font-size: 13px;
  }
  .summary-total {
    font-size: 16px;
  }
}

