/* ============================================
   JasCloud Order Form — Cherry Servers style
   ============================================ */

/* --- Deploy Layout --- */
.jas-deploy {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Centered layout when no summary panel (not logged in) */
.jas-deploy-centered {
  display: block !important;
  max-width: 750px;
  margin: 0 auto;
}

.jas-deploy-centered .jas-plan-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* When more than 3 cards, allow 4 columns in centered */
.jas-deploy-centered .jas-plan-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 180px));
  justify-content: center;
}

@media (max-width: 991px) {
  .jas-deploy {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .jas-deploy-centered .jas-plan-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
}

/* --- Group Tabs --- */
.jas-group-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}

.jas-group-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280 !important;
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.jas-group-tab:hover {
  color: #111827 !important;
}

.jas-group-tab-active {
  color: #2563eb !important;
  border-bottom-color: #2563eb;
}

/* --- Section Title --- */
.jas-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  margin-top: 0;
}

/* --- Plan Cards Grid --- */
.jas-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .jas-plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .jas-plan-grid { grid-template-columns: 1fr; }
}

/* --- Plan Card --- */
.jas-plan-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}

.jas-plan-card:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
}

.jas-plan-card.jas-plan-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.jas-plan-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.jas-plan-price {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.jas-plan-cycle {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

/* --- Specs --- */
.jas-plan-specs {
  text-align: left;
}

.jas-spec-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
}

.jas-spec-label {
  color: #6b7280;
}

.jas-spec-value {
  font-weight: 600;
  color: #111827;
  text-align: right;
}

/* --- Summary Panel --- */
.jas-summary {
  position: sticky;
  top: 80px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  padding: 20px;
}

.jas-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.jas-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.jas-summary-label {
  color: #6b7280;
}

.jas-summary-value {
  font-weight: 600;
  color: #111827;
}

.jas-summary-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 12px 0;
}

.jas-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.jas-total-label {
  font-size: 13px;
  font-weight: 500;
  color: #2563eb;
}

.jas-total-price {
  font-size: 18px;
  font-weight: 700;
  color: #2563eb;
}

.jas-deploy-time {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin: 12px 0;
}

.jas-deploy-time strong {
  color: #111827;
}

/* --- Pay Button --- */
.jas-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  background-color: #2563eb;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.15s;
  border: none;
  cursor: pointer;
}

.jas-pay-btn:hover {
  background-color: #1d4ed8;
  color: #ffffff !important;
}

.jas-reset-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #6b7280 !important;
  text-decoration: none !important;
  padding: 8px 0;
  transition: color 0.15s;
}

.jas-reset-btn:hover {
  color: #111827 !important;
}

/* --- Configure Product Page --- */
.jas-configure {
  max-width: 100%;
}

.jas-configure-header {
  margin-bottom: 16px;
}

.jas-configure-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}

.jas-configure-subtitle {
  font-size: 13px;
  color: #6b7280;
}

.jas-configure-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  background: #ffffff;
  margin-bottom: 12px;
}

.jas-configure-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}

/* --- Form Fields --- */
.jas-form-group {
  margin-bottom: 10px;
}

.jas-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
}

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

@media (max-width: 768px) {
  .jas-form-row { grid-template-columns: 1fr; }
}

.jas-form-input,
.jas-form-select,
.jas-form-textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.jas-form-textarea {
  height: auto;
  min-height: 56px;
  padding: 8px 10px;
  resize: vertical;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.jas-form-input:focus,
.jas-form-select:focus,
.jas-form-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.jas-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* --- Config Grid (2-col for options) --- */
.jas-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 768px) {
  .jas-config-grid { grid-template-columns: 1fr; }
}

.jas-config-cell {
  display: flex;
  flex-direction: column;
}

.jas-config-cell-full {
  grid-column: 1 / -1;
}

/* --- Custom Fields Grid --- */
.jas-custom-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 768px) {
  .jas-custom-fields-grid { grid-template-columns: 1fr; }
}

.jas-custom-fields-grid .jas-config-cell-full {
  grid-column: 1 / -1;
}

/* --- Radio & Checkbox labels --- */
.jas-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.jas-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.jas-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

/* --- Form hint --- */
.jas-form-hint {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* --- Configure actions --- */
.jas-configure-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* --- WHMCS custom field selects/textareas styling --- */
.jas-custom-fields-grid select,
.jas-custom-fields-grid textarea,
.jas-custom-fields-grid input[type="text"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background: #ffffff;
  box-sizing: border-box;
}

.jas-custom-fields-grid textarea {
  height: auto;
  min-height: 56px;
  padding: 8px 10px;
  resize: vertical;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.jas-custom-fields-grid select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* --- Old config option style (still used for addons) --- */
.jas-config-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.jas-config-option:last-child {
  border-bottom: none;
}

.jas-config-option-label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.jas-config-option-input {
  max-width: 200px;
}

/* --- Checkout / Cart --- */
.jas-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.jas-cart-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}

.jas-cart-table td {
  padding: 16px;
  font-size: 14px;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.jas-cart-total-row td {
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid #e5e7eb;
}

/* --- Buttons --- */
.jas-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  background-color: #2563eb;
  color: #ffffff !important;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.15s;
  border: none;
  cursor: pointer;
}

.jas-btn-primary:hover {
  background-color: #1d4ed8;
}

.jas-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151 !important;
  background: #ffffff;
  text-decoration: none !important;
  transition: background-color 0.15s;
  cursor: pointer;
}

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

.jas-btn-danger {
  color: #ef4444 !important;
  border-color: #fecaca;
}

.jas-btn-danger:hover {
  background-color: #fef2f2;
}

/* --- Alert / Error --- */
.jas-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.jas-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.jas-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

/* --- Hide WHMCS default order form chrome --- */
#order-standard_cart .header-lined,
#order-standard_cart .dropnav-header-lined,
.sidebar-categories-collapsed {
  display: none !important;
}
