/* ==========================================================================
   Single Page Form CSS - Professional Enhanced Design
   ========================================================================== */

:root {
  --primary-blue: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --success-green: #10B981;
  --error-red: #DC2626;
  --warning-orange: #F59E0B;
  
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

/* Container - Full Viewport */
.single-page-container {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #F9FAFB 0%, #FFFFFF 100%);
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

/* Single Page Form */
.single-page-form {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: white;
}

/* Professional Header */
.form-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: white;
  border-bottom: 2px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.form-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--gray-900);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: -0.5px;
}

.progress-dots {
  display: flex;
  gap: 20px;
  align-items: center;
}

.dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 2px;
  background: var(--gray-200);
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: -2px;
}

.dot:last-child::after {
  display: none;
}

.dot.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.dot.completed {
  background: var(--success-green);
  color: white;
  border-color: var(--success-green);
}

.dot.completed::after {
  background: var(--success-green);
}

/* Form Layout - 3 Column Grid */
.form-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
  background: var(--gray-100);
  overflow: hidden;
}

/* Form Panels */
.form-panel {
  background: white;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--gray-100);
}

.form-panel:last-child {
  border-right: none;
}

/* Panel Headers */
.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-blue);
  font-family: 'Noto Sans JP', sans-serif;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

/* Design Panel - Enhanced */
.design-panel {
  background: linear-gradient(to bottom, white, var(--gray-50));
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.design-card {
  position: relative;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  box-shadow: var(--shadow-sm);
}

.design-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.design-card.popular {
  border-color: var(--warning-orange);
}

.design-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.design-card input:checked + .card-content {
  border-color: var(--primary-blue);
  background: var(--primary-light);
}

.design-card input:checked + .card-content::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--primary-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: var(--shadow-md);
}

.card-content {
  padding: 12px;
  position: relative;
  text-align: center;
}

.design-card img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}

.card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.card-info .name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  font-family: 'Noto Sans JP', sans-serif;
}

.card-info .size {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.card-info .badge {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Size Selection Dropdown - Professional Style */
.size-selection {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-light), white);
  border-radius: 12px;
  border: 2px solid var(--primary-blue);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1);
}

.size-selection .field label {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.size-selection select {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.size-selection select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.size-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-600);
  display: none;
}

.size-info:not(:empty) {
  display: block;
}

.size-details {
  font-weight: 600;
  color: var(--gray-700);
}

/* Type Code Badge */
.type-code {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Custom Design Card */
.design-card.custom .card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.design-card.custom svg {
  color: var(--gray-400);
  transition: color 0.3s ease;
}

.design-card.custom:hover svg {
  color: var(--primary-blue);
}

.design-card.custom input:checked + .card-content svg {
  color: var(--primary-blue);
}

/* Custom Size Input Section */
.custom-size-input {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #FFF4E6, white);
  border-radius: 12px;
  border: 2px solid #FB923C;
  box-shadow: 0 4px 10px rgba(251, 146, 60, 0.1);
}

.custom-size-input .field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.custom-size-input input[type="number"],
.custom-size-input textarea {
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

.custom-size-input input[type="number"]:focus,
.custom-size-input textarea:focus {
  outline: none;
  border-color: #FB923C;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

/* More Sizes Dropdown - Enhanced */
.more-sizes {
  margin-top: 16px;
}

.more-sizes-btn {
  width: 100%;
  padding: 12px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.more-sizes-btn:hover {
  background: var(--gray-100);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.more-sizes[open] .more-sizes-btn {
  background: var(--primary-light);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.additional-sizes {
  margin-top: 12px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
}

.size-group {
  margin-bottom: 16px;
}

.size-group:last-child {
  margin-bottom: 0;
}

.size-group h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.size-options label {
  font-size: 13px;
  color: var(--gray-600);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  border: 1px solid transparent;
  background: white;
}

.size-options label:hover {
  background: var(--primary-light);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.size-options input {
  margin-right: 8px;
}

.size-options input:checked + label {
  background: var(--primary-light);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  font-weight: 600;
}

/* Form Fields - Enhanced Professional Style */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full-width {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.3px;
}

.field input,
.field select,
.field textarea {
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--primary-light);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--gray-400);
  font-size: 13px;
}

.field textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 120px;
  line-height: 1.5;
}

.field input.error,
.field select.error {
  border-color: var(--error-red);
  background: #FEF2F2;
}

.req {
  color: var(--error-red);
  font-weight: 700;
  font-size: 14px;
}

/* Radio Group - Professional Style */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.radio-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  font-weight: 500;
}

.radio-opt:hover {
  border-color: var(--primary-blue);
  background: var(--primary-light);
}

.radio-opt input {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.radio-opt input:checked {
  accent-color: var(--primary-blue);
}

.radio-opt input:checked ~ span {
  color: var(--primary-blue);
  font-weight: 700;
}

/* Submit Button - Professional CTA */
.form-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--gray-200);
}

.submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

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

.submit-btn:disabled {
  background: linear-gradient(135deg, var(--gray-400), var(--gray-500));
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.submit-btn svg {
  width: 20px;
  height: 20px;
}

/* Success Modal - Professional */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 450px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

.modal-content svg {
  color: var(--success-green);
}

.modal-content h2 {
  margin: 20px 0 12px;
  color: var(--gray-900);
  font-size: 24px;
  font-weight: 700;
}

.modal-content p {
  color: var(--gray-600);
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

/* Scrollbar Styling */
.form-panel::-webkit-scrollbar {
  width: 6px;
}

.form-panel::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.form-panel::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
}

.form-panel::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .form-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .design-panel {
    grid-column: 1 / -1;
    max-height: 40vh;
  }
  
  .design-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .form-header-compact {
    padding: 12px 16px;
  }
  
  .form-title {
    font-size: 18px;
  }
  
  .form-layout {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
  }
  
  .form-panel {
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }
  
  .design-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .field-row {
    grid-template-columns: 1fr;
  }
  
  .radio-group {
    flex-direction: column;
  }
  
  .radio-opt {
    width: 100%;
  }
}

/* Hide WordPress Admin Bar */
body.page-template-page-customer-form-php #wpadminbar {
  display: none !important;
}

body.page-template-page-customer-form-php {
  margin-top: 0 !important;
}

/* Hide Header and Footer for this page */
body.page-template-page-customer-form-php header,
body.page-template-page-customer-form-php footer {
  display: none !important;
}

/* Loading Animation */
.submit-btn.loading {
  position: relative;
  color: transparent;
}

.submit-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.8s linear infinite;
}

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

/* Form Notification */
.form-notification {
  position: fixed;
  top: 70px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  max-width: 350px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  font-weight: 500;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.form-notification.error {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  border: 2px solid var(--error-red);
  color: var(--error-red);
}

.form-notification.success {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border: 2px solid var(--success-green);
  color: #065F46;
}

.close-notification {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.close-notification:hover {
  opacity: 1;
}