/* ========= Fixed Full CSS (mobile-first) ========= */
/* Dependencies: Font Awesome 6 Free, Inter font, Cormorant Garamond font */

/* Base Styles */
:root {
  --deep-navy: #212F3D;
  --tech-blue: #3498DB;
  --fresh-green: #2ECC71;
  --pure-white: #FFFFFF;
  --light-gray: #F8FAFC;
  --medium-gray: #94A3B8;
  --accent-red: #EF4444;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-color: #e2e8f0;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --accent-color: var(--tech-blue);
  --background-color: #ffffff;
  --discount-color: var(--fresh-green);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--light-gray) 0%, #e2e8f0 100%);
  color: var(--deep-navy);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--deep-navy);
  gap: 10px;
  text-decoration: none;
}

.logo span {
  color: var(--tech-blue);
}

.trial-badge {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--deep-navy);
  background: #e0f2fe;
  padding: 8px 16px;
  border-radius: 20px;
}

.trial-badge a {
  color: var(--tech-blue);
  font-weight: 600;
  text-decoration: none;
}

.trial-badge a:hover {
  text-decoration: underline;
}

/* Main Onboarding */
main {
  flex: 1;
  padding: 40px 0 80px;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 40px;
}

.onboarding-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.onboarding-header p {
  font-size: 1.1rem;
  color: var(--medium-gray);
  max-width: 600px;
  margin: 0 auto;
}

/* Progress Bar */
.progress-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  max-width: 800px;
  margin: 0 auto 50px;
}

.progress-container::before {
  content: "";
  position: absolute;
  top: 33%;
  left: 0;
  right: 0;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.progress-bar {
  position: absolute;
  top: 33%;
  left: 0;
  height: 4px;
  background: linear-gradient(to right, var(--tech-blue), var(--fresh-green));
  transform: translateY(-50%);
  z-index: 2;
  transition: width 0.4s ease-in-out;
}

.progress-step {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33.33%;
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--pure-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--medium-gray);
  border: 2px solid #e2e8f0;
  margin-bottom: 10px;
  transition: var(--transition);
}

.progress-step.active .step-icon {
  background: var(--tech-blue);
  color: var(--pure-white);
  border-color: var(--tech-blue);
}

.progress-step.completed .step-icon {
  background: var(--fresh-green);
  color: var(--pure-white);
  border-color: var(--fresh-green);
}

.step-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--medium-gray);
  text-align: center;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
  color: var(--deep-navy);
  font-weight: 600;
}

/* Form Card */
.onboarding-card {
  background: var(--pure-white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.form-step {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.form-step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--deep-navy);
  text-align: center;
}

.step-description {
  font-size: 1.1rem;
  color: var(--medium-gray);
  text-align: center;
  margin-bottom: 32px;
}

/* Form Elements */
.form-section.collapsed .subscription-form-request,
.form-section.collapsed .btn-container {
  display: none;
}

.form-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section-title i.toggle-icon {
  transition: transform 0.2s ease;
  cursor: pointer;
}

.form-section.collapsed .form-section-title i.toggle-icon {
  transform: rotate(-90deg);
}

.form-section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title i {
  color: var(--tech-blue);
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--medium-gray);
  margin-top: 4px;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input.invalid,
textarea.invalid {
  border-color: var(--accent-red);
}

input.invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input:read-only,
input:read-only:focus {
  border: 1px solid #cbd5e1;
  color: var(--dark-gray);
}

input#siret {
  color: #000;
  font-weight: bold;
}

.input-group {
  display: flex;
  gap: 16px;
}

.input-group .form-group {
  flex: 1;
}

.input-with-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
  padding-right: 8px;
}

.btn svg {
  flex-shrink: 0;
}

/* Hide File Inputs */
#logo-input,
#background-input,
#menu-upload,
#camera-input {
  display: none;
}

/* Main box for displaying signature data */
.signature-review-box {
  padding: 0;
  background-color: transparent;
}

.review-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.review-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.review-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.review-section-title i {
  margin-right: 10px;
  color: var(--tech-blue);
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 0.95rem;
}

.info-label {
  color: #718096;
  padding-right: 16px;
}

.info-value {
  font-weight: 500;
  color: #2d3748;
  text-align: right;
}

/* Special styling for the 'terms accepted' line */
.terms-accepted-line {
  margin-top: 16px;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
}

.terms-accepted-line.accepted {
  color: #2f855a;
  background-color: #c6f6d5;
}

.terms-accepted-line.not-accepted {
  color: #c53030;
  background-color: #fed7d7;
}

/* Collapsible technical details section */
#tech-details {
  margin-top: 20px;
}

#tech-details summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--tech-blue);
  outline: none;
  padding: 4px;
}

#tech-details summary:hover {
  text-decoration: underline;
}

#tech-details .info-value code {
  display: inline-block;
  word-wrap: break-word;
  word-break: break-all;
  background-color: #edf2f7;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  max-width: 250px;
}

/* Terms & Conditions */
.accept-terms-container {
  background: var(--light-gray);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  overflow-y: auto;
}

.terms-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.terms-text p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--deep-navy);
  margin-bottom: 1em;
}

.subscription-agreement {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.subscription-agreement label {
  margin-bottom: 0;
  cursor: pointer;
}

.subscription-agreement input[type="checkbox"] {
  width: auto;
  accent-color: var(--tech-blue);
}

/* Styles for Image Thumbnails */
.review-thumbnail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.review-thumbnail-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 2px solid #cbd5e0;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.review-thumbnail-image:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Styles for Image Modal */
.review-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.review-modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.review-modal-close-button {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.review-modal-close-button:hover,
.review-modal-close-button:focus {
  color: #bbb;
  text-decoration: none;
}

/* Checkbox Styles */
.big-check {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--tech-blue);
  border-radius: 8px;
  background: var(--pure-white);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  position: relative;
  margin-right: 12px;
  flex-shrink: 0;
}

.big-check:focus-visible {
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.25);
}

.big-check::after {
  content: "";
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center;
  background-size: contain;
  color: var(--tech-blue);
}

.big-check:checked {
  background: #e9f2ff;
  border-color: var(--tech-blue);
}

.big-check:checked::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

.checkbox-text {
  flex: 1;
}

.big-check:invalid~.error-message {
  display: block;
}

/* Menu Preview */
.menu-preview {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.menu-preview .preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  font-size: 0.7rem;
  text-align: center;
  padding: 4px;
}

.menu-preview .preview-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.menu-preview .preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--pure-white);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 12px;
}

/* Camera Modal */
.camera-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  backdrop-filter: blur(5px);
}

.camera-modal.active {
  display: flex;
}

.camera-preview {
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000;
}

.camera-preview video {
  width: 100%;
  height: auto;
  display: block;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.camera-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--pure-white);
}

.camera-btn.capture {
  background: var(--tech-blue);
}

.camera-btn.capture:hover {
  background: #2980b9;
}

.camera-btn.cancel {
  background: var(--accent-red);
}

.camera-btn.cancel:hover {
  background: #c0392b;
}

.camera-error {
  color: var(--accent-red);
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

/* Success Screen */
.success-container {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  font-size: 4rem;
  color: var(--fresh-green);
  margin-bottom: 24px;
  animation: popIn 0.5s ease-out;
}

@keyframes popIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  80% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-container h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.success-container p {
  color: var(--medium-gray);
  margin-bottom: 32px;
}

/* Buttons */
.btn-container {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

.btn-container.center {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--tech-blue);
  color: var(--tech-blue);
}

.btn-outline:hover:not(:disabled) {
  background: var(--tech-blue);
  color: var(--pure-white);
}

.btn-primary {
  background: var(--tech-blue);
  color: var(--pure-white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(52, 152, 219, 0.15);
}

.btn-success {
  background: var(--fresh-green);
  color: var(--pure-white);
}

.btn-success:hover:not(:disabled) {
  background: #27ae60;
  transform: translateY(-2px);
}

/* Simulated Layout Area for Branding */
.btn-order {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.preview-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  justify-content: space-between;
  border-radius: 6px;
  position: relative;
  z-index: 3;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.preview-image.logo-preview {
  width: 40px;
  height: 40px;
  object-fit: contain;
  padding: 4px;
  border-radius: 4px;
  display: none;
}

.business-name-preview {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
  border-radius: 4px;
}

.preview-switcher-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.preview-switcher-btn:hover {
  background: #f3f4f6;
  border-color: var(--tech-blue);
}

.preview-switcher-btn:focus {
  outline: 2px solid var(--tech-blue);
  outline-offset: 2px;
}

.preview-label {
  margin-right: 6px;
}

/* --- Main Card Container --- */
.subscription-card {
  font-family: var(--primary-font);
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  padding: 1.5rem 2rem;
  max-width: 450px;
  margin: 2rem auto;
}

/* --- Typography --- */
.subscription-card h3 {
  font-size: 1.2rem;
  color: var(--text-color-dark);
  margin-top: 0;
  margin-bottom: 1rem;
}

/* --- Styled Horizontal Rule --- */
.subscription-card hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 1.75rem 0;
}

/* --- General List Styling --- */
.subscription-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Subscription Summary List (Plan/Price) --- */
#subscription-form-summary .summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  margin: 0 2rem;
}

#subscription-form-summary .summary-line span {
  color: var(--text-color-light);
}

#subscription-form-summary .summary-line strong {
  color: var(--text-color-dark);
  font-weight: 600;
}

/* --- Included Features List (Checkmarks) --- */
#subscription-form-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-color-dark);
  font-size: 0.95rem;
}

#subscription-form-features li::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-color: var(--success-color);
  border-radius: 50%;
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');
  -webkit-mask-size: 65%;
  mask-size: 65%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

#subscription-form-summary .billing-item {
  width: 100%;
  margin: 0 2rem;
}

#subscription-form-summary .billing-item strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: #212529;
}

#subscription-form-summary .billing-item p {
  margin: 0;
  color: #6c757d;
  line-height: 1.5;
}

/* --- Main Container --- */
.contract-summary-container {
  font-family: var(--primary-font);
  background-color: var(--bg-color);
  border-radius: 12px;
  max-width: 800px;
  margin: 2rem auto;
}

/* --- List Styles --- */
.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Card Styles for each Item --- */
.summary-item {
  cursor: pointer;
  background-color: var(--card-bg-color);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.summary-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* --- Icons using ::before pseudo-element --- */
.summary-item::before {
  content: '';
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background-color: var(--icon-color);
  -webkit-mask-size: 60%;
  mask-size: 60%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  border-radius: 8px;
}

/* Specific Icons (using SVG masks for clean, scalable icons) */
.item-user::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
}

.item-processor::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/></svg>');
}

.item-security::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>');
}

/* --- Content Typography --- */
.summary-content strong {
  display: block;
  font-size: 1.1rem;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}

.summary-content p {
  margin: 0;
  color: var(--text-color);
  line-height: 1.6;
}

/* --- Link Styles --- */
.summary-content a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.summary-content a:hover {
  color: var(--heading-color);
  text-decoration: underline;
}

/* Legal / Branding Preview */
.legal-card-inline {
  background: var(--pure-white);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

.legal-grid-inline {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Subscription Summary */
.subscription-summary h3,
.included-features h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #222;
}

.subscription-summary ul,
.included-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subscription-summary li,
.included-features li {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.subscription-summary li:last-child,
.included-features li:last-child {
  border-bottom: none;
}

.included-features li em {
  color: #888;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 15px 0;
}

.branding-preview {
  position: relative;
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  min-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.branding-preview img.preview-image#background-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.branding-preview .menu-preview-overlay {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.25);
  padding: 15px;
  border-radius: 8px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: #333;
  font-family: 'Inter', sans-serif;
  flex: 1;
}

.menu-preview-overlay h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #000;
}

.menu-preview-overlay ul {
  list-style: none;
  margin-bottom: 15px;
}

.menu-preview-overlay li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.85rem;
}

.menu-preview-overlay li span:first-child {
  flex: 1;
  text-align: left;
}

.menu-preview-overlay li span:last-child {
  font-weight: 600;
  color: var(--tech-blue);
  margin-right: 10px;
}

/* Menu Category / Grid / Items */
.menu-category h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: #1a1a1a;
  letter-spacing: 1px;
  border-bottom: 1px solid #666;
  padding-bottom: 0.5rem;
}

.menu-grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.menu-item-card {
  border: 1px solid #eaeaea;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.menu-item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.item-image-wrapper {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background-color: #f0f0f0;
}

.item-image-wrapper svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: #ccc;
}

.item-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.menu-item-card:hover .item-image-wrapper img {
  transform: scale(1.05);
}

/* FIXED: Consolidated item-details (removed duplicate) */
.item-details {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  margin: 0 0 0.5rem 0;
}

.item-description {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  flex-grow: 1;
}

.item-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #666;
  text-align: right;
  margin-top: auto;
}

/* Upload Areas */
.upload-areas-container {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.upload-area {
  background: #ffffff;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 10px 0;
  cursor: pointer;
  transition: border-color 0.3s ease;
  flex: 1;
}

.upload-area:hover {
  border-color: var(--tech-blue);
}

.upload-area.dragover {
  border-color: var(--tech-blue);
  background: #f0f8ff;
}

.upload-icon {
  font-size: 2rem;
  color: #666;
  margin-bottom: 10px;
}

.upload-text {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}

.upload-subtext {
  font-size: 0.85rem;
  color: #666;
}

/* Contract Container (Modal) */
.contract-container {
  display: flex;
  flex-direction: column;
  height: 90%;
  width: 90%;
  max-width: 1000px;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.contract-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

/* The Modal (background) */
.review-contract-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

/* Modal Content (the document viewer) */
.contract-modal-content {
  background-color: #fefefe;
  border: 1px solid #888;
  width: 80%;
  height: 90%;
  max-width: 1000px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  overflow: hidden;
}

/* The Close Button */
.contract-modal-close-button {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.contract-modal-close-button:hover,
.contract-modal-close-button:focus {
  color: #bbb;
  text-decoration: none;
}

/* FIXED: Removed duplicate .contract-options, kept only .tier-options */
.tier-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 15px;
  padding: 10px;
}

.tier-option {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.tier-option.disabled {
  background: rgba(50, 50, 50, 0.1);
}

.tier-option.disabled .tier-price {
  color: var(--medium-gray);
}

.tier-option:hover {
  border-color: var(--tech-blue);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.tier-option.selected {
  border-color: var(--tech-blue);
  background: #f0f8ff;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.tier-option.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--tech-blue);
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
}

.tier-option h4 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.tier-option p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.tier-option .tier-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tech-blue);
  margin: 10px 0 0;
}

.error-message#selected-tier-error {
  display: none;
  color: #d32f2f;
  font-size: 0.85rem;
  margin-top: 5px;
  text-align: left;
}

.title-error {
  color: var(--accent-red);
}

.title-warning,
.title-notice,
.title-information {
  color: var(--deep-navy);
}

.privacy-link {
  /* Appearance */
  color: #007bff;
  /* A standard blue for links */
  text-decoration: none;
  /* Remove default underline */
  font-weight: 500;
  /* Slightly bolder than normal text for emphasis */

  /* Spacing & Layout */
  display: inline;
  margin: 0;
  padding: 0;

  /* Interaction */
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.privacy-link:hover {
  color: #0056b3;
  /* Darker blue on hover */
  text-decoration: underline;
  /* Add underline on hover for accessibility */
}

.privacy-link:focus {
  /* Ensures accessibility and visibility when tab-navigating */
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.form-group.invalid .error-message#selected-tier-error {
  display: block;
}

/* Loading Button */
.btn-loading {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.btn-loading::after {
  content: '\f1ce';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  animation: spin 1s linear infinite;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Tab Navigation Styling */
.preview-tabs {
  display: flex;
  border-bottom: 1px solid #cbd5e1;
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: #4a5568;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
  background-color: #f7fafc;
}

.tab-btn.active {
  color: #2d3748;
  font-weight: 600;
  border-bottom-color: var(--tech-blue);
}

/* Tab Panels */
.tab-panels {
  max-height: 365px;
  overflow-x: scroll;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Menu Category Nav */
.menu-category-nav {
  display: flex;
  gap: 10px;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.menu-category-nav::-webkit-scrollbar {
  display: none;
}

.category-button {
  background-color: transparent;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.category-button:hover {
  color: var(--text-primary);
}

.category-button.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* --- Card Layout Adjustment: allergens, price, sizes --- */
.item-info {
  margin-bottom: 15px;
}

.item-allergens {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 12px;
}

.item-price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 10px;
  align-self: flex-end;
}

.item-price-new {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.item-price-old {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}

/* Size Selection */
.item-size-selection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.size-option {
  display: flex;
  align-items: center;
}

.size-option label {
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  padding-left: 28px;
}

.size-option .size-price {
  margin-left: auto;
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-primary);
}

/* Custom Radio Button */
.size-option input[type="radio"] {
  opacity: 0;
  width: 0;
  margin: 0;
}

.size-option label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background-color: var(--background-color);
  transition: border-color 0.3s;
}

.size-option label:hover::before {
  border-color: var(--text-primary);
}

.size-option input[type="radio"]:checked+label::before {
  border-color: var(--text-primary);
}

.size-option label::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-primary);
  transition: transform 0.3s ease;
}

.size-option input[type="radio"]:checked+label::after {
  transform: translateY(-50%) scale(1);
}

.form-signature {
  display: none;
}

/* Verification Code */
.verification-code-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem auto;
}

.form-section-verification {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.code-input {
  width: 3rem;
  height: 3rem;
  text-align: center;
  font-size: 1.5rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input:focus {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.resend-text {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-align: center;
}

.resend-text a {
  color: var(--tech-blue);
  text-decoration: underline;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid var(--tech-blue);
  border-radius: 50%;
  animation: spinLoader 1s linear infinite;
  margin-bottom: 10px;
}

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

/* ========== Consolidated Responsive Rules ========== */
@media (max-width: 768px) {
  .onboarding-card {
    padding: 30px 20px;
  }

  .input-group,
  .branding-options {
    flex-direction: column;
    gap: 20px;
  }

  .step-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step-label {
    font-size: 0.8rem;
  }

  .btn-container {
    flex-direction: column-reverse;
    gap: 16px;
  }

  .btn {
    width: 100%;
  }

  .camera-preview {
    width: 95%;
    max-height: 60vh;
  }

  .branding-preview {
    min-height: 280px;
  }

  .menu-preview-overlay {
    font-size: 0.8rem;
    padding: 10px;
  }

  .menu-preview-overlay h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .menu-preview-overlay li {
    font-size: 0.75rem;
    padding: 3px 0;
  }

  .upload-areas-container {
    flex-direction: column;
    gap: 10px;
  }

  .upload-area {
    padding: 15px;
  }

  .tier-options {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .tier-option {
    padding: 15px;
  }

  .tier-option h4 {
    font-size: 1.1rem;
  }

  .tier-option p {
    font-size: 0.85rem;
  }

  .tier-option .tier-price {
    font-size: 1rem;
  }

  .preview-nav {
    gap: 8px;
    padding: 8px;
  }

  .preview-image.logo-preview {
    width: 60px;
    height: 60px;
  }

  .business-name-preview {
    font-size: 0.95rem;
    max-width: 140px;
  }

  .preview-switcher-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .preview-label {
    margin-right: 4px;
  }

  .code-input {
    width: 2.5rem;
    height: 2.5rem;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-label {
    padding-right: 0;
    margin-bottom: 4px;
  }

  .info-value {
    text-align: left;
  }

  .input-with-button {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .accept-terms-container {
    padding: 12px;
  }

  .input-group {
    gap: 0;
  }

  #subscription-form-summary .billing-item {
    margin: 0 0.2rem;
  }

  #subscription-form-summary .summary-line {
    margin: 0 0.2rem;
  }
}