/* Subscription-specific styles */

/* Progressive Disclosure Styles */
.progressive-header {
  background: linear-gradient(135deg, #ff6b00 0%, #e85f00 100%);
  color: white;
  padding: 30px;
  margin: -20px -20px 30px -20px;
  border-radius: 12px 12px 0 0;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  margin-top: 20px;
  overflow: hidden;
}

.progress-fill {
  background: white;
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 33.33%;
}

.step-indicators {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding: 0 20px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.step-indicator.active {
  opacity: 1;
  font-weight: 600;
}

.step-indicator.completed {
  opacity: 1;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.step-indicator.active .step-number {
  background: white;
  color: #ff6b00;
}

.step-indicator.completed .step-number {
  background: #28a745;
  color: white;
}

.form-section {
  margin-bottom: 30px;
  padding: 30px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.5s ease;
  position: relative;
}

.form-section.active {
  border-color: #ff6b00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
  background: #fff8f5;
}

.form-section.completed {
  border-color: #28a745;
  background: #f8fff9;
}

.form-section.locked {
  opacity: 0.5;
  pointer-events: none;
  background: #f8f9fa;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.section-icon {
  font-size: 24px;
}

.section-status {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-active {
  background: #ffe5d1;
  color: #cc4400;
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-locked {
  background: #f8f9fa;
  color: #6c757d;
}

.section-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.btn-primary {
  background: #ff6b00;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #e85f00;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.completion-message {
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 12px;
  margin-top: 20px;
}

.completion-message h2 {
  margin: 0 0 10px 0;
  font-size: 24px;
}

.field-validation {
  font-size: 14px;
  margin-top: 5px;
  min-height: 20px;
}

.validation-error {
  color: #dc3545;
}

.validation-success {
  color: #28a745;
}

/* Responsive design for progressive disclosure */
@media (max-width: 768px) {
  .step-indicators {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .section-actions {
    flex-direction: column;
    gap: 15px;
  }
  
  .progressive-header {
    margin: -20px -10px 20px -10px;
    padding: 20px;
  }
  
  .form-section {
    padding: 20px;
  }
}

/* Plan Selection */
.plan-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.plan-price {
  font-size: 24px;
  font-weight: bold;
  color: #ff6b00;
  margin-bottom: 15px;
}

.plan-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-features li {
  padding: 5px 0;
  color: #555;
  display: flex;
  align-items: flex-start;
}

.plan-features li:before {
  content: "✓ ";
  color: #28a745;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Remove automatic checkmark for features with sub-items since we add it manually */
.plan-features li.has-subfeatures:before {
  content: "";
  margin-right: 0;
}

/* Sub-features styling with circles */
.plan-subfeatures {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.plan-subfeatures li {
  padding: 5px 0;
  color: #555;
  display: flex;
  align-items: flex-start;
}

.plan-subfeatures li:before {
  content: "○ ";
  color: #6c757d;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Nested sub-features with tilde (~) - indented under main features */
.plan-features li.has-subfeatures {
  flex-direction: column;
}

.plan-features .sub-item {
  margin-left: 24px;
  margin-top: 3px;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: flex-start;
}

.plan-features .sub-item:before {
  content: "~ ";
  color: #6c757d;
  font-weight: normal;
  margin-right: 6px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Quantity Selector */
.quantity-selector {
  margin-top: 15px;
  display: block;
}

.quantity-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.quantity-selector select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  background-color: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  box-sizing: border-box;
}

.quantity-selector select:focus {
  outline: none;
  border-color: #ff6b00;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.1);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

.quantity-info {
  margin-top: 10px;
  padding: 10px;
  background: #f0f8ff;
  border-radius: 6px;
  font-size: 14px;
  color: #0066cc;
}

/* Order Summary */
.order-summary {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.summary-total {
  font-weight: bold;
  font-size: 18px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
  margin-top: 10px;
}


/* Email validation styles */
.card-validation-feedback {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.4;
}

.validation-success {
  color: #28a745;
}

.validation-error {
  color: #dc3545;
}

.screen-name-info {
  font-size: 13px;
  color: #6c757d;
  margin-top: 5px;
  font-style: italic;
}

.validation-info {
  color: #007bff;
}

/* Input validation states */
input.card-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

input.card-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

input.card-incomplete {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.card-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

select.card-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Email verification styles */
.email-input-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.email-input-wrapper {
  flex: 1;
  position: relative;
}

.email-input-wrapper input {
  width: 100%;
  margin: 0;
}

/* Phone verification styles - mirror email verification */
.phone-input-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.phone-input-wrapper {
  flex: 1;
  position: relative;
}

.phone-input-wrapper input {
  width: 100%;
  margin: 0;
}

.verify-button {
  background-color: #ff6b00;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  height: 48px;
  box-sizing: border-box;
  flex-shrink: 0;
  margin-top: 0;
}

.verify-button:hover:not(:disabled) {
  background-color: #e85f00;
}

.verify-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Email lock indicator */
.email-lock-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.email-input-wrapper.locked .email-lock-indicator {
  opacity: 1;
}

.email-input-wrapper.locked input {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  padding-right: 40px;
}

.email-input-wrapper.verified input {
  background-color: #d4edda;
  border-color: #28a745;
}

.email-input-wrapper.verified .email-lock-indicator {
  opacity: 1;
  color: #28a745;
}

/* Phone lock indicator - mirror email styling */
.phone-lock-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.phone-input-wrapper.locked .phone-lock-indicator {
  opacity: 1;
}

.phone-input-wrapper.locked input {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  padding-right: 40px;
}

.phone-input-wrapper.verified input {
  background-color: #d4edda;
  border-color: #28a745;
}

.phone-input-wrapper.verified .phone-lock-indicator {
  opacity: 1;
  color: #28a745;
}

/* Email verify dropdown */
.email-verify-dropdown {
  position: relative;
  flex-shrink: 0;
}

/* Phone verify dropdown - mirror email styling */
.phone-verify-dropdown {
  position: relative;
  flex-shrink: 0;
}

.verify-button {
  background-color: #ff6b00;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.verify-button:hover:not(:disabled) {
  background-color: #e85f00;
}

.verify-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.verify-button.verified {
  background-color: #28a745;
}

.verify-button.verified:hover:not(:disabled) {
  background-color: #218838;
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.dropdown-arrow.hidden {
  opacity: 0;
}

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background-color 0.2s ease;
  border-radius: 0;
}

.dropdown-item:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.dropdown-item:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.danger {
  color: #dc3545;
}

.dropdown-item.danger:hover {
  background-color: #f8d7da;
}

.dropdown-action {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
  font-family: inherit;
}

.dropdown-action:hover {
  background: none;
}

.dropdown-action.cancel {
  color: #dc3545;
}

.dropdown-action.resend {
  color: #007bff;
}

.dropdown-action.change {
  color: #6c757d;
}

/* Email verification feedback */
.email-verification-feedback {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
  min-height: 20px;
}

.email-verification-feedback .countdown {
  font-weight: bold;
  color: #ff6b00;
}

.email-verification-feedback .countdown.warning {
  color: #ffc107;
}

.email-verification-feedback .countdown.danger {
  color: #dc3545;
}

/* Phone verification feedback row - spans country code and phone number */
.phone-verification-feedback-row {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.phone-verification-feedback-row .form-group:first-child {
  flex: 0.3;
}

.phone-verification-feedback {
  flex: 2.7;
  font-size: 14px;
  line-height: 1.4;
  min-height: 20px;
  margin-top: 0;
}

/* Adjust country field width in the phone row */
.form-row .form-group:has(#country) {
  flex: 0.3;
}

.form-row .form-group:has(#countryCode) {
  flex: 1;
}

.form-row .form-group:has(#phone) {
  flex: 1.7;
}

.phone-verification-feedback .countdown {
  font-weight: bold;
  color: #ff6b00;
}

.phone-verification-feedback .countdown.warning {
  color: #ffc107;
}

.phone-verification-feedback .countdown.danger {
  color: #dc3545;
}

/* Info button styles */
.info-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  margin-left: 8px;
  flex-shrink: 0;
  position: relative;
  align-self: flex-start;
  margin-top: 12px;
}

.info-button:hover {
  background-color: #5a6268;
  transform: scale(1.1);
}

.info-icon {
  line-height: 1;
  font-style: normal;
}

/* Tooltip styles - absolute positioning relative to button */
.info-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.4;
  white-space: pre-line;
  width: 320px !important;
  max-width: 320px !important;
  min-width: 320px !important;
  height: auto;
  max-height: none;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box !important;
  overflow: visible;
}

.info-button::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  pointer-events: none;
}

/* Adjust tooltip position to avoid going off-screen */
.info-button::after {
  /* Shift left if too close to right edge */
  right: clamp(auto, auto, 20px);
}

/* Ensure parent containers don't clip tooltips */
.email-verify-dropdown,
.phone-verify-dropdown,
.form-section,
.notification-section {
  overflow: visible !important;
}

.info-button:hover::after,
.info-button:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Adjust email and phone verify dropdown containers to accommodate info button */
.email-verify-dropdown,
.phone-verify-dropdown {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Auto-fill tooltip styles for zip code lookup */
.auto-fill-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  z-index: 1000;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 200px;
  width: auto;
}

.auto-fill-tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* Zip lookup tooltip for not found cases */
.zip-lookup-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #dc3545;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  z-index: 1000;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 200px;
  width: auto;
}

.zip-lookup-tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* Auto-filled field styling */
.auto-filled {
  background-color: #d4edda !important;
  border-color: #28a745 !important;
  transition: all 0.3s ease;
}

/* Zip not found field styling */
.zip-not-found {
  background-color: #f8d7da !important;
  border-color: #dc3545 !important;
  transition: all 0.3s ease;
}

/* Ensure form groups have relative positioning for tooltips */
.form-group {
  position: relative;
}

/* Responsive design for email and phone verification */
@media (max-width: 480px) {
  .email-input-group,
  .phone-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .verify-button {
    height: auto;
    padding: 12px 16px;
    justify-content: center;
  }
  
  .dropdown-menu {
    right: 0;
    left: 0;
    min-width: auto;
  }
  
  .email-verify-dropdown,
  .phone-verify-dropdown {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .info-button {
    margin-top: 0;
    align-self: center;
  }
  
  .info-button::after {
    max-width: 200px;
    left: auto;
    right: 0;
    transform: none;
  }
  
  .info-button::before {
    left: auto;
    right: 12px;
    transform: none;
  }
  
  /* Mobile responsive tooltips for auto-fill */
  .auto-fill-tooltip,
  .zip-lookup-tooltip {
    font-size: 12px;
    padding: 6px 10px;
  }
}
