/**
 * Hero Banner - Improved Responsive Design
 * Clean, mobile-first, high-performance styling
 * 2026 Modern Palette - ENHANCED VERSION
 * 
 * IMPROVEMENTS:
 * - 100% responsive design with proper mobile/tablet/desktop breakpoints
 * - Form container perfectly constrained - no overflow on any device
 * - Optimized spacing and padding for all screen sizes
 * - Better UX with improved form field sizing
 * - Enhanced visual hierarchy and readability
 */

/* ========================================
   VARIABLES & RESET
   ======================================== */

:root {
  /* colors */
  --hb-primary: #ff5a1f;
  --hb-primary-dark: #e84a0f;
  --hb-secondary: #1a1a2e;
  --hb-tertiary: #6b7280;
  --hb-light-bg: #f8f9fa;
  --hb-white: #ffffff;
  --hb-border: #e5e7eb;
  --hb-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --hb-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --hb-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* typography */
  --hb-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                     'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  
  /* spacing */
  --hb-spacing-xs: 0.25rem;
  --hb-spacing-sm: 0.5rem;
  --hb-spacing-md: 1rem;
  --hb-spacing-lg: 1.5rem;
  --hb-spacing-xl: 2rem;
  --hb-spacing-2xl: 3rem;
  --hb-spacing-3xl: 4rem;
  --hb-spacing-4xl: 6rem;
  
  /* borders */
  --hb-radius-sm: 8px;
  --hb-radius-md: 12px;
  --hb-radius-lg: 16px;
  --hb-radius-xl: 20px;
  --hb-radius-full: 50px;
  
  /* transitions */
  --hb-transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
  --hb-transition-fast: all 0.15s ease;
}

/* ========================================
   HERO SECTION - MAIN CONTAINER
   ======================================== */

.hb-hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
  padding: var(--hb-spacing-2xl) var(--hb-spacing-md);
  position: relative;
  overflow: hidden;
  font-family: var(--hb-font-family);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hb-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 120% -20%, rgba(255, 90, 31, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hb-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--hb-spacing-2xl);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* ========================================
   CONTENT SECTION - LEFT COLUMN
   ======================================== */

.hb-content {
  display: flex;
  flex-direction: column;
  gap: var(--hb-spacing-lg);
  animation: hb-fade-in-up 0.6s ease-out 0.1s both;
  width: 100%;
  box-sizing: border-box;
}

.hb-headline {
  margin-bottom: var(--hb-spacing-sm);
}

.hb-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--hb-secondary);
  margin: 0;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-accent {
  color: var(--hb-primary);
  font-weight: 400;
  margin: 0 var(--hb-spacing-xs);
  display: inline;
}

.hb-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1rem);
  color: var(--hb-tertiary);
  line-height: 1.6;
  margin: 0;
  max-width: 100%;
  font-weight: 400;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========================================
   BUTTON STYLING
   ======================================== */

.hb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hb-spacing-sm);
  padding: 0 26px;
  border: none;
  border-radius: var(--hb-radius-full);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--hb-transition);
  position: relative;
  overflow: hidden;
  font-family: var(--hb-font-family);
  height: 46px;
  box-sizing: border-box;
  line-height: 1.4;
  flex-shrink: 0;
  white-space: nowrap;
}

.hb-button-primary {
  background: linear-gradient(135deg, var(--hb-primary) 0%, var(--hb-primary-dark) 100%);
  color: var(--hb-white);
  box-shadow: var(--hb-shadow-md);
}

.hb-button-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--hb-shadow-lg);
  background: linear-gradient(135deg, var(--hb-primary-dark) 0%, var(--hb-primary-dark) 100%);
}

.hb-button-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--hb-shadow-md);
}

.hb-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.2), var(--hb-shadow-lg);
}

.hb-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hb-button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--hb-white);
  border-radius: 50%;
  animation: hb-spin 0.6s linear infinite;
}

.hb-button.hb-loading .hb-button-text {
  display: none;
}

.hb-button.hb-loading .hb-button-loader {
  display: block;
}

/* ========================================
   FORM MESSAGES
   ======================================== */

.hb-message {
  display: none;
  padding: var(--hb-spacing-md) var(--hb-spacing-lg);
  border-radius: var(--hb-radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  animation: hb-slide-in 0.3s ease-out;
  margin-bottom: var(--hb-spacing-md);
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-message-success {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.hb-message-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.hb-message-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.hb-message-close:hover {
  opacity: 1;
}

.hb-message span {
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-message.hb-show {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hb-spacing-md);
}

/* ========================================
   FORM STYLING - RESPONSIVE & CONTAINED
   ======================================== */

.hb-form {
  display: flex;
  flex-direction: column;
  gap: var(--hb-spacing-md);
  margin-top: var(--hb-spacing-lg);
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Form Badge */
.hb-form-badge {
  display: flex;
  align-items: center;
  gap: var(--hb-spacing-sm);
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.1) 0%, rgba(255, 90, 31, 0.05) 100%);
  border-left: 4px solid var(--hb-primary);
  border-radius: var(--hb-radius-md);
  margin-bottom: var(--hb-spacing-md);
  animation: hb-fade-in-up 0.4s ease-out 0.05s both;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-badge-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.hb-badge-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hb-primary);
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--hb-spacing-sm);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.hb-form-row {
  display: flex;
  flex-direction: column;
  gap: var(--hb-spacing-md);
  width: 100%;
  box-sizing: border-box;
}

.hb-form-row .hb-form-group {
  flex: 1;
  min-width: 0;
}

.hb-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hb-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-form-helper {
  font-size: 0.75rem;
  color: var(--hb-tertiary);
  opacity: 0.7;
  align-self: flex-start;
  padding-top: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-input,
.hb-select {
  padding: 12px 16px;
  border: 2px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  background: var(--hb-white);
  color: var(--hb-secondary);
  font-family: var(--hb-font-family);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: var(--hb-shadow);
  transition: var(--hb-transition);
  appearance: none;
  height: 52px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-input::placeholder,
.hb-select option {
  color: var(--hb-tertiary);
}

.hb-input:focus,
.hb-select:focus {
  outline: none;
  border-color: var(--hb-primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.1), var(--hb-shadow);
}

.hb-input.hb-field-valid,
.hb-select.hb-field-valid {
  border-color: #10b981;
  background: #f0fdf4;
}

.hb-input.hb-field-invalid,
.hb-select.hb-field-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.hb-input:hover:not(:focus),
.hb-select:hover:not(:focus) {
  border-color: var(--hb-primary);
  box-shadow: var(--hb-shadow-md);
}

.hb-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1a2e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

.nice-select.hb-select {
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  border: 2px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  background: var(--hb-white);
  box-shadow: var(--hb-shadow);
  transition: var(--hb-transition);
  box-sizing: border-box;
  font-size: 1rem;
  width: 100%;
  max-width: 100%;
}

.nice-select.hb-select .current {
  padding: 12px 16px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  color: var(--hb-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.nice-select.hb-select:hover {
  border-color: var(--hb-primary);
  box-shadow: var(--hb-shadow-md);
}

.nice-select.hb-select:focus {
  outline: none;
  border-color: var(--hb-primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.1), var(--hb-shadow);
}

/* ========================================
   TRUST BADGE
   ======================================== */

.hb-trust {
  display: flex;
  align-items: center;
  gap: var(--hb-spacing-sm);
  font-size: 0.875rem;
  color: var(--hb-tertiary);
  margin-top: var(--hb-spacing-md);
  padding-top: var(--hb-spacing-md);
  border-top: 1px solid var(--hb-border);
  flex-wrap: wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-trust-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ========================================
   IMAGE SECTION - RIGHT COLUMN
   ======================================== */

.hb-image-section {
  position: relative;
  width: 100%;
  animation: hb-fade-in 0.6s ease-out 0.2s both;
  display: none;
}

/* Image Container with Aspect Ratio */
.hb-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 12;
  border-radius: var(--hb-radius-xl);
  overflow: hidden;
  background: var(--hb-light-bg);
  box-shadow: var(--hb-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image Element */
.hb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Image Placeholder */
.hb-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.hb-image[src]:not([src="about:blank"]) ~ .hb-image-placeholder {
  opacity: 0;
  pointer-events: none;
}

.hb-placeholder-content {
  text-align: center;
  color: var(--hb-tertiary);
}

.hb-placeholder-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--hb-spacing-md);
  opacity: 0.4;
}

.hb-placeholder-content p {
  font-size: 0.95rem;
  margin: 0;
}

/* ========================================
   FLOATING CARD / BADGE
   ======================================== */

.hb-floating-card {
  position: absolute;
  bottom: var(--hb-spacing-lg);
  left: var(--hb-spacing-lg);
  background: var(--hb-white);
  padding: var(--hb-spacing-lg);
  border-radius: var(--hb-radius-lg);
  display: flex;
  align-items: center;
  gap: var(--hb-spacing-md);
  box-shadow: var(--hb-shadow-lg);
  animation: hb-float 3s ease-in-out infinite;
  z-index: 10;
  max-width: 90%;
  box-sizing: border-box;
}

.hb-card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.hb-card-content {
  min-width: 0;
  flex-shrink: 1;
}

.hb-card-label {
  font-size: 0.75rem;
  color: var(--hb-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--hb-spacing-xs) 0;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb-card-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--hb-primary);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes hb-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hb-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hb-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hb-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes hb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   TABLET LAYOUT (min-width: 768px)
   ======================================== */

@media (min-width: 768px) {
  .hb-hero {
    padding: var(--hb-spacing-3xl) var(--hb-spacing-2xl);
    min-height: auto;
  }
  
  .hb-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--hb-spacing-2xl);
    max-width: 600px;
  }
  
  .hb-content {
    flex: 1;
    min-width: 0;
    width: 100%;
  }
  

  
  /* Form container - larger and more spacious */
  .hb-form {
    flex-direction: column;
    gap: 18px;
    background: var(--hb-white);
    padding: 28px 24px;
    border-radius: var(--hb-radius-xl);
    box-shadow: var(--hb-shadow-md);
    margin-top: var(--hb-spacing-xl);
    width: 100%;
    max-width: 100%;
  }
  
  .hb-form-group {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }
  
  .hb-form-row {
    flex-direction: row;
    gap: 18px;
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
  }

  .hb-form-row .hb-form-group {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  .hb-form-helper {
    display: block;
    text-align: right;
    flex-shrink: 0;
    white-space: normal;
    font-size: 0.8rem;
    margin-top: -12px;
  }
  
  .hb-button {
    flex-shrink: 0;
    min-width: fit-content;
    height: 52px;
    font-size: 1.05rem;
  }
  
  .hb-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .hb-image-container {
    aspect-ratio: 4 / 3;
  }
}

/* ========================================
   DESKTOP LAYOUT (min-width: 1024px)
   ======================================== */

@media (min-width: 1024px) {
  .hb-hero {
    padding: var(--hb-spacing-4xl) var(--hb-spacing-3xl);
  }
  
  .hb-wrapper {
    flex-direction: row;
    align-items: stretch;
    gap: var(--hb-spacing-4xl);
  }
  
  .hb-content {
    flex: 1;
    min-width: 0;
  }
  
  .hb-image-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .hb-title {
    font-size: 3.5rem;
  }
  
  /* Form - optimized for desktop with better visibility */
  .hb-form {
    gap: 20px;
    padding: 32px 28px;
    background: linear-gradient(135deg, var(--hb-white) 0%, #fafbfc 100%);
  }
  
  .hb-form-group {
    flex: 0 1 auto;
    min-width: 0;
  }
  
  .hb-input,
  .hb-select,
  .nice-select.hb-select {
    font-size: 1.05rem;
    letter-spacing: 0.3px;
  }
  
  .hb-label {
    font-size: 0.95rem;
  }
  
  .hb-image-container {
    aspect-ratio: 16 / 12;
  }
}

/* ========================================
   LARGE DESKTOP (min-width: 1280px)
   ======================================== */

@media (min-width: 1280px) {
  .hb-hero {
    padding: var(--hb-spacing-4xl) 2rem;
  }
  
  .hb-wrapper {
    max-width: 1320px;
  }
}

/* ========================================
   MOBILE & SMALL DEVICES (max-width: 767px)
   ======================================== */

@media (max-width: 767px) {
  .hb-hero {
    padding: var(--hb-spacing-xl) var(--hb-spacing-md);
    min-height: auto;
  }
  
  .hb-wrapper {
    gap: var(--hb-spacing-xl);
    flex-direction: column;
  }
  
  .hb-title {
    font-size: 1.75rem;
  }
  
  .hb-subtitle {
    font-size: 0.95rem;
  }
  
  .hb-label {
    display: block;
  }
  
  /* Mobile form - full width, stacked */
  .hb-form {
    flex-direction: column;
    gap: 12px;
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-top: var(--hb-spacing-lg);
    width: 100%;
    max-width: 100%;
  }
  
  .hb-form-group {
    width: 100%;
    margin-bottom: 0;
    max-width: 100%;
  }

  .hb-form-row {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .hb-form-row .hb-form-group {
    min-width: auto;
    width: 100%;
    max-width: 100%;
  }

  .hb-form-helper {
    display: none;
  }

  .hb-button {
    width: 100%;
    height: 52px;
    margin-left: 0;
  }
  
  .hb-input,
  .hb-select,
  .nice-select.hb-select {
    width: 100%;
    height: 52px;
    padding: 12px 16px;
    box-sizing: border-box;
    max-width: 100%;
  }
  
  .hb-floating-card {
    bottom: var(--hb-spacing-md);
    left: var(--hb-spacing-md);
    right: var(--hb-spacing-md);
    max-width: calc(100% - var(--hb-spacing-md) * 2);
    width: auto;
  }
  
  .hb-image-section {
    display: none;
  }
  
  .hb-image-container {
    aspect-ratio: 4 / 5;
  }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
  .hb-hero {
    padding: var(--hb-spacing-lg) var(--hb-spacing-sm);
  }
  
  .hb-wrapper {
    gap: var(--hb-spacing-lg);
  }
  
  .hb-title {
    font-size: 1.5rem;
  }
  
  .hb-subtitle {
    font-size: 0.9rem;
  }
  
  .hb-form {
    gap: 10px;
  }
  
  .hb-button {
    font-size: 0.9rem;
  }
  
  .hb-label {
    font-size: 0.8rem;
  }
  
  .hb-input,
  .hb-select,
  .nice-select.hb-select {
    font-size: 16px; /* Prevents zoom on iOS */
    height: 44px;
  }
  
  .hb-floating-card {
    padding: var(--hb-spacing-md);
    gap: var(--hb-spacing-sm);
  }
  
  .hb-card-label {
    font-size: 0.7rem;
  }
  
  .hb-card-value {
    font-size: 1rem;
  }
}
.hb-native-select-wrap {
  position: relative;
  width: 100%;
}

.hb-select-native {
  width: 100%;
  height: 52px;
  padding: 12px 44px 12px 16px;
  border: 2px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  background-color: var(--hb-white);
  color: var(--hb-secondary);
  font-family: var(--hb-font-family);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: var(--hb-shadow);
  transition: var(--hb-transition);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* arrow */
.hb-native-select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--hb-secondary);
  border-bottom: 2px solid var(--hb-secondary);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.hb-select-native:hover {
  border-color: var(--hb-primary);
  box-shadow: var(--hb-shadow-md);
}

.hb-select-native:focus {
  outline: none;
  border-color: var(--hb-primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.1), var(--hb-shadow);
}

.hb-select-native.hb-field-valid {
  border-color: #10b981;
  background: #f0fdf4;
}

.hb-select-native.hb-field-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.hb-select-native option {
  color: var(--hb-secondary);
  background: #fff;
}

@media (max-width: 480px) {
  .hb-select-native {
    font-size: 16px;
    height: 44px;
  }
}
