/**
 * Independence Warranty Frontend Styles
 * 
 * General plugin styles for frontend
 */

/* Plugin-wide styles can go here */

/**
 * Button Shortcode Styles
 * 
 * Simple alignment utilities - theme handles button styling
 */

/* Button Alignment */
.button-align-center {
    text-align: center;
}

.button-align-right {
    text-align: right;
}

/**
 * My Account Widget Styles
 * 
 * Clean, minimal account interface similar to Stripe dashboard
 */

/* Widget Container */
.iw-my-account-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

/* Main Container */
.iw-account-container {
    display: flex;
    min-height: 400px;
}

/* Navigation */
.iw-account-navigation {
    background: #fafafa;
    border-right: 1px solid #e6e6e6;
    flex-shrink: 0;
    width: 240px;
}

.iw-nav-list {
    list-style: none;
    margin: 0;
    padding: 16px 0;
    padding-left: 0 !important;
}

.iw-nav-item {
    margin: 0;
}

.iw-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.iw-nav-link:hover {
    background: #f3f4f6;
    color: #1a1a1a;
    text-decoration: none;
}

.iw-nav-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.iw-nav-icon {
    font-size: 16px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.iw-nav-text {
    font-size: 14px;
}

/* Content Area */
.iw-account-content {
    flex: 1;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
}

.iw-content-section {
    display: none;
    height: 100%;
}

.iw-content-section.active {
    display: block;
}

.iw-section-header {
    padding: 24px 32px 16px;
    border-bottom: 1px solid #e6e6e6;
    background: #ffffff;
}

.iw-section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.iw-section-content {
    padding: 24px 32px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .iw-account-container {
        flex-direction: column;
    }
    
    .iw-account-navigation {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #e6e6e6;
    }
    
    .iw-nav-list {
        display: flex;
        overflow-x: auto;
        padding: 0;
        margin: 0 !important;
        justify-content: center;
        -webkit-overflow-scrolling: touch;
    }
    
    .iw-nav-item {
        flex-shrink: 0;
    }
    
    .iw-nav-link {
        padding: 16px 20px;
        white-space: nowrap;
        border-right: none;
    }
    
    .iw-nav-link.active {
        border-right: none;
        border-bottom: 2px solid #1a1a1a;
    }
    
    .iw-nav-content {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    .iw-nav-icon {
        font-size: 18px;
    }
    
    .iw-nav-text {
        font-size: 12px;
    }
    
    .iw-section-content {
        padding: 20px 16px;
    }
    
    .iw-section-header {
        padding: 20px 16px 16px;
    }
}

@media (max-width: 480px) {
    .iw-section-content {
        padding: 16px;
    }
    
    .iw-section-header {
        padding: 16px;
    }
    
    .iw-nav-link {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Custom Scrollbar */
.iw-section-content::-webkit-scrollbar {
    width: 4px;
}

.iw-section-content::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.iw-section-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.iw-section-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus States for Accessibility */
.iw-nav-link:focus {
    outline: 2px solid #234471;
    outline-offset: -2px;
}

/* Container */
#gform_wrapper_0 {
    max-width: 400px;
    margin: 60px auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    font-family: "Inter", "Helvetica Neue", sans-serif;
    color: #234471;
}

/* Title */
#gform_wrapper_0 .gform_title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #234471;
}

/* Labels */
#gform_wrapper_0 .gfield_label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
    color: #234471;
}

/* Inputs */
#gform_wrapper_0 input[type="text"],
#gform_wrapper_0 input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#gform_wrapper_0 input[type="text"]:focus,
#gform_wrapper_0 input[type="password"]:focus {
    border-color: #fca431;
    box-shadow: 0 0 0 3px rgba(252,164,49,0.2);
}

/* Remember Me */
#gform_wrapper_0 .gfield_checkbox label {
    font-size: 0.85rem;
    color: #234471;
}

/* Button */
#gform_submit_button_0 {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1rem;
    background: #fca431;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#gform_submit_button_0:hover {
    background: #e29128;
}

/* Links */
.gf_login_links {
    text-align: center;
    margin-top: 1rem;
}

.gf_login_links a {
    font-size: 0.85rem;
    color: #234471;
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem 0;
    transition: color 0.2s;
}

.gf_login_links a:hover {
    color: #fca431;
}

/* ===============================
   Registration form - SaaS look
   Target: #gform_wrapper_1
   Accent: #fca431   Primary text: #234471
================================= */

/* Card container */
#gform_wrapper_1 {
    max-width: 560px;
    margin: 64px auto;
    padding: 2rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    color: #234471;
  }
  
  /* Tighten GF theme to our palette via CSS vars */
  #gform_wrapper_1.gform-theme {
    --gf-color-primary: #fca431;
    --gf-color-primary-rgb: 252, 164, 49;
    --gf-color-primary-contrast: #fff;
  
    --gf-color-secondary: #234471;
    --gf-color-secondary-contrast: #fff;
  
    --gf-ctrl-border-color: #d1d5db;
    --gf-ctrl-label-color-primary: #234471;
    --gf-ctrl-label-color-secondary: #234471;
  
    --gf-radius: 10px;
  }
  
  /* ===============================
     Labels and titles
  ================================= */
  
  /* Normalize all field titles (labels + legends) */
  #gform_wrapper_1 legend.gfield_label,
  #gform_wrapper_1 .gfield_label {
    font-size: 0.95rem !important;
    font-weight: 550;
    color: #234471 !important;
    margin-bottom: 0.375rem;
    line-height: 1.4;
  }
  
  /* Sub-labels under complex fields (First, Last, etc.) */
  #gform_wrapper_1 .gform-field-label--type-sub {
    font-size: 0.8rem;
    color: #5b6b83;
    font-weight: 400;
  }
  
  /* (Required) text */
  #gform_wrapper_1 .gfield_required_text {
    font-size: 0.75rem;
    font-weight: 400;
    color: #e65a5a;
    margin-left: 0.25rem;
  }
  
  /* ===============================
     Inputs
  ================================= */
  
  #gform_wrapper_1 input[type="text"],
  #gform_wrapper_1 input[type="email"],
  #gform_wrapper_1 input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }
  
  /* Focus state */
  #gform_wrapper_1 input[type="text"]:focus,
  #gform_wrapper_1 input[type="email"]:focus,
  #gform_wrapper_1 input[type="password"]:focus {
    border-color: #fca431;
    box-shadow: 0 0 0 3px rgba(252,164,49,0.25);
  }
  
  /* ===============================
     Layout & help text
  ================================= */
  
  /* Two column fields spacing */
  #gform_wrapper_1 .gform-grid-row {
    gap: 14px;
  }
  
  /* Help text */
  #gform_wrapper_1 .gfield_description {
    font-size: 0.85rem;
    color: #5b6b83;
    margin: 0.35rem 0 0.5rem;
  }
  
  /* ===============================
     Validation styles
  ================================= */
  
  #gform_wrapper_1 .gform_validation_errors,
  #gform_wrapper_1 .gfield.gfield_error .gfield_description.validation_message {
    background: rgba(235, 87, 87, 0.08);
    color: #8b1c1c;
    border: 1px solid rgba(235, 87, 87, 0.35);
    padding: 0.75rem 1rem;
    border-radius: 10px;
  }
  
  #gform_wrapper_1 .gfield.gfield_error input {
    border-color: #e65a5a;
    box-shadow: 0 0 0 3px rgba(230, 90, 90, 0.15);
  }
  
  /* ===============================
     Submit button
  ================================= */
  
  #gform_submit_button_1 {
    width: 100%;
    padding: 0.95rem 1rem;
    margin-top: 0.75rem;
    background: #fca431;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.05s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 16px rgba(252,164,49,0.35);
  }
  
  #gform_submit_button_1:hover {
    background: #e29128;
  }
  
  #gform_submit_button_1:active {
    transform: translateY(1px);
  }
  
  /* Footer spacing */
  #gform_wrapper_1 .gform_footer,
  #gform_wrapper_1 .gform-footer {
    margin-top: 1rem;
  }
  
  /* ===============================
     Responsive tweaks
  ================================= */
  @media (max-width: 520px) {
    #gform_wrapper_1 { 
      padding: 1.25rem; 
      margin: 32px auto; 
    }
    #gform_wrapper_1 legend.gfield_label,
    #gform_wrapper_1 .gfield_label {
      font-size: 0.9rem !important;
    }
  }
  
  /* ===============================
     Optional: background behind card
  ================================= */
  body.has-auth-bg {
    background:
      radial-gradient(1200px 600px at 10% -10%, rgba(252,164,49,0.08), transparent 60%),
      radial-gradient(1200px 600px at 110% 10%, rgba(35,68,113,0.08), transparent 60%),
      #f7f8fb;
  }

/* ===============================
   My Account Widget Styles
   Updated to match login/registration aesthetic
   Primary: #234471  Accent: #fca431
================================= */

.iw-my-account-widget {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: #234471;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}

.iw-account-container {
  display: flex;
  min-height: 500px;
}

/* Navigation Styles */
.iw-account-navigation {
  background: #f8f9fb;
  border-right: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  min-width: 250px;
}

.iw-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.iw-nav-item {
  margin: 0;
}

.iw-nav-link {
  display: block;
  padding: 0.875rem 1.5rem;
  color: #234471;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.iw-nav-link:hover {
  background: rgba(252, 164, 49, 0.08);
  color: #234471;
  text-decoration: none;
}

.iw-nav-link.active {
  background: rgba(252, 164, 49, 0.12);
  border-left-color: #fca431;
  color: #234471;
  font-weight: 600;
}

.iw-nav-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.iw-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.iw-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.iw-nav-text {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Content Area */
.iw-account-content {
  flex: 1;
  padding: 2rem;
}

.iw-content-section {
  display: none;
}

.iw-content-section.active {
  display: block;
}

.iw-section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.iw-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #234471;
  margin: 0;
}

.iw-section-content {
  color: #234471;
  line-height: 1.6;
}

.iw-section-content p {
  margin-bottom: 1rem;
  color: #5b6b83;
}

/* ===============================
   Form Styles within My Account Widget
   Target: #gform_wrapper_4 (and similar)
   No card/container styling - flat design
================================= */

.iw-my-account-widget #gform_wrapper_4,
.iw-my-account-widget .gform_wrapper {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif !important;
  color: #234471 !important;
}

/* Override GF theme variables for consistency */
.iw-my-account-widget #gform_wrapper_4.gform-theme,
.iw-my-account-widget .gform_wrapper.gform-theme {
  --gf-color-primary: #fca431 !important;
  --gf-color-primary-rgb: 252, 164, 49 !important;
  --gf-color-primary-contrast: #fff !important;
  
  --gf-color-secondary: #234471 !important;
  --gf-color-secondary-contrast: #fff !important;
  
  --gf-ctrl-border-color: #d1d5db !important;
  --gf-ctrl-label-color-primary: #234471 !important;
  --gf-ctrl-label-color-secondary: #234471 !important;
  
  --gf-radius: 8px !important;
}

/* Field Labels */
.iw-my-account-widget .gfield_label,
.iw-my-account-widget legend.gfield_label {
  font-size: 0.95rem !important;
  font-weight: 550 !important;
  color: #234471 !important;
  margin-bottom: 0.375rem !important;
  line-height: 1.4 !important;
}

/* Sub-labels */
.iw-my-account-widget .gform-field-label--type-sub {
  font-size: 0.8rem !important;
  color: #5b6b83 !important;
  font-weight: 400 !important;
  margin-top: 0.25rem !important;
}

/* Input Fields */
.iw-my-account-widget input[type="text"],
.iw-my-account-widget input[type="email"],
.iw-my-account-widget input[type="password"] {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-size: 0.95rem !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  font-family: inherit !important;
}

/* Focus states */
.iw-my-account-widget input[type="text"]:focus,
.iw-my-account-widget input[type="email"]:focus,
.iw-my-account-widget input[type="password"]:focus {
  border-color: #fca431 !important;
  box-shadow: 0 0 0 3px rgba(252,164,49,0.2) !important;
}

/* Grid layout for password fields */
.iw-my-account-widget .gform-grid-row {
  gap: 14px !important;
}

/* Submit Button */
.iw-my-account-widget #gform_submit_button_4,
.iw-my-account-widget .gform_button {
  min-width: 160px;
  background: #fca431 !important;
  color: #234471 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0.7rem 1.5rem !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease-in-out;
  font-family: inherit !important;
}

.iw-my-account-widget #gform_submit_button_4:hover,
.iw-my-account-widget .gform_button:hover,
.button:hover {
  color: #234471 !important;
  background-color: #fec479 !important;
}

.iw-my-account-widget #gform_submit_button_4:active,
.iw-my-account-widget .gform_button:active {
  transform: translateY(1px) !important;
}

/* Form footer spacing */
.iw-my-account-widget .gform-footer,
.iw-my-account-widget .gform_footer {
  margin-top: 1.5rem !important;
  padding: 0 !important;
}

/* Validation styles */
.iw-my-account-widget .gform_validation_errors,
.iw-my-account-widget .gfield.gfield_error .gfield_description.validation_message {
  background: rgba(235, 87, 87, 0.08) !important;
  color: #8b1c1c !important;
  border: 1px solid rgba(235, 87, 87, 0.35) !important;
  padding: 0.75rem 1rem !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  margin: 0.5rem 0 !important;
}

.iw-my-account-widget .gfield.gfield_error input {
  border-color: #e65a5a !important;
  box-shadow: 0 0 0 3px rgba(230, 90, 90, 0.15) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .iw-account-container {
    flex-direction: column;
  }
  
  .iw-account-navigation {
    width: 100% !important;
    min-width: auto;
    padding: 1rem 0;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .iw-nav-list {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0 1rem;
  }
  
  .iw-nav-item {
    flex-shrink: 0;
  }
  
  .iw-nav-link {
    padding: 0.75rem 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
  }
  
  .iw-nav-link.active {
    border-left: none;
    border-bottom-color: #fca431;
  }
  
  .iw-account-content {
    padding: 1.5rem;
  }
  
  .iw-section-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
	.iw-account-navigation {
        padding: 0;
    }
	
	.iw-nav-list {
		display: flex;
		flex-wrap: wrap;
		gap: 0;
	}
	
	.iw-nav-list .iw-nav-item {
		width: 50%;
	}
	
	.iw-nav-link {
        border-radius: 10px 10px 0 0;
    }
	
	.iw-nav-list .iw-nav-item .iw-nav-text {
		font-size: 0.8rem;
	}
	
	.iw-account-content {
        padding: 2rem 1rem;
    }
}