/**
 * Main Styles for DBBS Signup Form
 * Contains all general styling for the form
 */

/* Prevent auto-zoom on input fields */
@viewport {
  width: device-width;
  zoom: 1.0;
  user-zoom: fixed;
}

/* iOS-specific zoom prevention */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  font-size: 16px !important; /* Minimum font size to prevent zoom on iOS */
  max-height: none; /* Ensure form fields don't shrink */
}

/* Mobile Safari specific styles */
@media screen and (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important; /* Maintain 16px on mobile */
  }

  /* Ensure font size is maintained during focus */
  input:focus, select:focus, textarea:focus {
    font-size: 16px !important;
  }

  /* Set a reasonable font size on placeholders */
  ::placeholder {
    font-size: 16px !important;
  }
}

/* Define main color variables */
:root {
    --primary-color: #ff6b00;     /* Main orange color */
    --primary-hover: #e56000;     /* Darker orange for hover */
    --secondary-color: #6b7280;   /* Gray for secondary elements */
    --success-color: #10b981;     /* Green for success messages */
    --danger-color: #ef4444;      /* Red for errors */
    --warning-color: #f59e0b;     /* Amber for warnings */
    --light-bg: #f8fafc;          /* Light background */
    --border-color: #e5e7eb;      /* Border color */
    --text-color: #333333;        /* Main text color */
    --text-muted: #64748b;        /* Muted text color */
    --card-shadow: 0 3.4px 17px rgba(0, 0, 0, 0.08); /* Card shadow */
}

/* General Layout */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    line-height: 1.6;
    font-size: 0.95rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Sticky Header Styles */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.sticky-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1000px;
}

.sticky-header .logo-left {
  text-align: left;
}

.sticky-header .logo-left img {
  height: 60px;
}

.sticky-header .logo-left .tagline {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sticky-header .logo-right {
  text-align: right;
}

.sticky-header .logo-right .powered-label {
  color: #374151;
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.sticky-header .logo-right img {
  height: 40px;
  max-width: 120px;
  object-fit: contain;
}

/* Main content */
.main-content {
  margin-top: 90px;
}

/* Responsive header adjustments */
@media (max-width: 768px) {
  .sticky-header {
    padding: 10px;
  }

  .sticky-header .logo-left img {
    height: 45px;
  }

  .sticky-header .logo-right img {
    height: 30px;
  }

  .main-content {
    margin-top: 70px;
  }
}

/* Form Container */
.form-container {
    background-color: white;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    padding: 35px;
    margin-bottom: 35px;
}

/* Form Step Navigation */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Headings */
h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
}

h2.step-title {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Desktop Progress Bar Styles */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

.desktop-progress-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 35px;
}

.segmented-progress-bar {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  height: 35px;
  padding-bottom: 45px;
}

.segmented-progress-bar .step {
  width: 35px;
  height: 35px;
  position: relative;
  flex-shrink: 0;
  text-align: center;
}

.segmented-progress-bar .step-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #e9ecef;
  border: 3px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  z-index: 2;
  position: relative;
  margin: 0;
}

.segmented-progress-bar .step-circle::before {
  content: attr(data-step);
  color: #adb5bd;
  font-size: 0.8em;
  font-weight: bold;
  transition: color 0.4s ease;
}

.segmented-progress-bar .step-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  text-align: center;
  font-size: 0.75em;
  color: #6c757d;
}

.segmented-progress-bar .connector {
  flex-grow: 1;
  height: 4px;
  background-color: #e9ecef;
  border-radius: 2px;
  margin: 0 -3px;
  z-index: 1;
  transition: background 0.4s ease;
}

.segmented-progress-bar .step.completed .step-circle {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.segmented-progress-bar .step.completed .step-circle::before {
  content: '✔';
  color: white;
  font-size: 1em;
}

.segmented-progress-bar .step.completed .step-label {
  color: #495057;
}

.segmented-progress-bar .step.active .step-circle {
  background-color: #fff;
  border-color: var(--primary-color);
  animation: pulse 1.5s infinite cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 4;
}

.segmented-progress-bar .step.active .step-circle::before {
  color: var(--primary-color);
}

.segmented-progress-bar .step.active .step-label {
  color: #000;
  font-weight: bold;
}

.segmented-progress-bar .connector.completed {
  background: linear-gradient(90deg, var(--primary-hover), var(--primary-color));
}

/* Make desktop progress bar responsive */
@media (max-width: 768px) {
  .desktop-progress-container {
    overflow-x: auto;
    padding-bottom: 15px;
  }

  .segmented-progress-bar {
    min-width: 600px;
    padding: 0 20px;
  }
}

/* Mobile Progress Bar Styles */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1);
  padding: 5px 8px;
  z-index: 1000;
  border-top: 1px solid var(--border-color);
}

.mobile-progress {
  margin-bottom: 4px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.step-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.step-text .current-step {
  font-weight: 600;
  color: var(--primary-color);
}

.step-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-color);
}

.progress-bar {
  height: 3px;
  background-color: #e9ecef;
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-hover), var(--primary-color));
  transition: width 0.3s ease;
}

.mobile-buttons {
  display: flex;
  gap: 6px;
}

.mobile-buttons .btn {
  flex: 1;
  padding: 5px;
  font-size: 0.85rem;
}

/* Media query to show/hide navigation based on screen size */
@media (max-width: 991px) {
  .mobile-nav-bar {
    display: block;
  }

  /* Hide the mobile progress indicator since we now have it in the navigation bar */
  .mobile-progress-indicator {
    display: none;
  }

  /* Hide form buttons on mobile */
  .form-step .navigation-buttons {
    display: none;
  }

  /* Add padding to the bottom of the page to account for fixed navigation */
  body {
    padding-bottom: 60px;
  }

  /* Make sure form container has proper bottom padding */
  .form-container {
    padding-bottom: 15px;
  }

  /* Hide the desktop progress bar on tablets and mobile devices */
  .desktop-progress-container {
    display: none;
  }
}

/* Category Cards */
.category-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.2);
}

.category-card.selected .card-title {
    color: var(--primary-color);
}

.category-card.selected i {
    color: var(--primary-color);
    transform: scale(1.2);
}

.category-card i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

/* Requirements Styles */
.requirements-container {
    margin-bottom: 30px;
}

.requirements-list {
    margin: 30px 0;
}

.requirement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.requirement-item:last-child {
    border-bottom: none;
}

.requirement-icon {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    background-color: rgba(255, 107, 0, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 15px;
}

.requirement-details {
    flex: 1;
    text-align: center;
    max-width: 90%;
}

.requirement-details h4 {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .requirement-item {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .requirement-icon {
        margin-right: 20px;
        margin-bottom: 0;
    }

    .requirement-details {
        text-align: left;
    }
}

.requirements-check {
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 10px;
}

/* Form Controls */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-color);
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Button Styles */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn:disabled {
    background-color: #eda678;
    border-color: #eda678;
    opacity: 0.85;
    cursor: not-allowed;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Map Styles */
#map, #business-map {
    height: 300px;
    width: 100%;
    border-radius: 10px;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Card Styles */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Plan Card Styles */
.plan-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.plan-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.plan-card .card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.plan-card .card-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-color);
}

.plan-speed {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
}

.plan-speed-value {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.plan-speed-prefix {
    font-size: 1.3rem;
    font-weight: 500;
    display: block;
    opacity: 0.9;
    margin-bottom: 5px;
}

.plan-speed-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 5px;
}

.price-box {
    padding: 1.2rem;
    background-color: var(--light-bg);
    text-align: center;
    border-bottom: 1px solid #eee;
}

.price-box .currency {
    font-size: 1.1rem;
    vertical-align: top;
    position: relative;
    top: 0.3rem;
    font-weight: 500;
}

.price-box .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-box .period {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: inline-block;
    margin-left: 0.25rem;
}

.plan-features {
    padding: 15px;
}

.plan-feature-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.plan-feature-item:last-child {
    border-bottom: none;
}

.plan-card .card-footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
}

/* Alert Styling */
.alert {
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.alert-info {
    background-color: #e0f2fe;
    color: #0369a1;
}

.alert-success {
    background-color: #dcfce7;
    color: #15803d;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.terms-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Debug Box Styles */
.debug-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 300px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1000;
    transition: height 0.3s ease;
}

.debug-box.minimized {
    height: 40px;
}

.debug-header {
    padding: 10px;
    background-color: rgba(255, 107, 0, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debug-header h5 {
    margin: 0;
    font-size: 0.9rem;
}

.debug-content {
    padding: 10px;
    height: calc(100% - 40px);
    overflow-y: auto;
}

.debug-content pre {
    margin: 0;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: 15px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2.step-title {
        font-size: 1.1rem;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .navigation-buttons .btn {
        width: 100%;
    }

    .navigation-buttons .btn:first-child {
        order: 2;
    }

    .navigation-buttons .btn:last-child {
        order: 1;
    }

    .debug-box {
        width: 90%;
        right: 5%;
        bottom: 70px;
    }
}

/* Specific to select plan button */
.select-plan-btn {
    color: #555;
    background-color: #f8f8f8;
    border-color: #ddd;
    font-weight: 500;
}
