/* Modern auth UI - scoped to auth pages via container classes */

.post_content_title.sc_layouts_title_title {
  display: none !important;
}
.inline-triplet input {
  width: 100% !important;
}

/* Override .contents styles when combined with .auth-container */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Hide vertical scrollbar but keep scrolling functionality */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.contents.auth-container::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* For Firefox */
html {
  scrollbar-width: none;
}

/* For IE and Edge */
html {
  -ms-overflow-style: none;
}

.contents.auth-container {
  width: 100% !important;
  max-width: 960px !important;
  padding: 20px 16px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Fix content containers on auth pages */
.content_wrap,
.content_container {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* Fix footer_copyright_wrap on auth pages */
.footer_copyright_wrap {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.auth-container { max-width: 960px; margin: 0 auto; padding: 20px 16px; min-height: 100vh; display: flex; align-items: center; justify-content: center; box-sizing: border-box; overflow-x: hidden; }
.auth-container { margin-top: 0 !important; }
.auth-grid { display: grid; grid-template-columns: 1fr; gap: 0; width: 100%; justify-items: center; margin: 0; padding: 0; box-sizing: border-box; }
@media (min-width: 900px) { .auth-grid { grid-template-columns: 1fr; gap: 0; } }

.auth-card { background: #fff; border-radius: 12px; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 8px 30px rgba(0,0,0,0.06); overflow: hidden; width: 100%; max-width: 520px; }
.auth-card--wide { max-width: 920px; }
.auth-card .auth-header { padding: 24px 28px; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; gap: 10px; }
.auth-card .auth-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
.auth-card .auth-body { padding: 24px 28px; }
.auth-card .auth-footer { padding: 20px 28px; background: #fafafa; border-top: 1px solid rgba(0,0,0,0.06); }

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .contents.auth-container {
    padding: 15px 12px !important;
    padding-top: 20px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .auth-container { 
    padding: 15px 12px; 
    min-height: calc(100vh - 40px);
    align-items: flex-start;
    padding-top: 20px;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .auth-grid {
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
  }
  
  .auth-card { 
    max-width: 100%; 
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: 0;
    width: 100%;
  }
  
  .auth-card .auth-header { 
    padding: 20px 16px; 
    gap: 8px;
  }
  
  .auth-card .auth-header h1 { 
    font-size: 20px; 
  }
  
  .auth-card .auth-header i {
    font-size: 18px;
  }
  
  .auth-card .auth-body { 
    padding: 20px 16px; 
  }
  
  .auth-card .auth-footer { 
    padding: 12px 16px; 
  }
  
  .auth-footer .auth-cta {
    margin-bottom: 4px;
    gap: 8px;
  }
  
  .auth-footer .auth-help {
    margin-top: 4px;
    gap: 4px;
  }
  
  .input-group > input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .contents.auth-container {
    padding: 10px 8px !important;
    padding-top: 15px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .auth-container { 
    padding: 10px 8px; 
    padding-top: 15px;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .auth-grid {
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
  }
  
  .auth-card .auth-header { 
    padding: 16px 12px; 
  }
  
  .auth-card .auth-header h1 { 
    font-size: 18px; 
  }
  
  .auth-card .auth-body { 
    padding: 16px 12px; 
  }
  
  .auth-card .auth-footer { 
    padding: 10px 12px; 
  }
  
  .auth-footer .auth-cta {
    margin-bottom: 2px;
    gap: 4px;
  }
  
  .auth-footer .auth-cta span {
    margin-bottom: 2px;
  }
  
  .auth-footer .auth-help {
    margin-top: 2px;
    gap: 2px;
  }
  
  .auth-footer .auth-help li {
    margin: 0;
  }
  
  .input-group { 
    width: 100%;
  }
  
  .input-group > i {
    left: 10px;
    font-size: 13px;
  }
  
  .input-group > input { 
    padding: 12px 12px 12px 34px; 
    font-size: 16px; /* Prevents zoom on iOS */
    width: 100%;
    box-sizing: border-box;
  }
  
  .btn.modern-primary,
  .btn.modern-secondary { 
    padding: 14px 16px; 
    font-size: 16px; /* Prevents zoom on iOS */
    width: 100%;
    box-sizing: border-box;
  }
  
  .field-row {
    width: 100%;
  }
  
  .field-row .label {
    font-size: 14px;
  }
}

.auth-help { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-help a { color: #2b6cb0; text-decoration: none; }
.auth-help a:hover { text-decoration: underline; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group > i { position: absolute; left: 12px; color: #8a8f98; font-size: 14px; }
.input-group > input { width: 100%; padding: 12px 12px 12px 38px; border: 1px solid #e2e8f0; border-radius: 8px; outline: none; transition: box-shadow .2s, border-color .2s; }
.input-group > input:focus { border-color: #3182ce; box-shadow: 0 0 0 4px rgba(49,130,206,0.15); }

.btn.modern-primary { background: #0d4bc1; color: #fff; border: none; padding: 12px 16px; border-radius: 8px; cursor: pointer; width: 100%; font-weight: 600; }
.btn.modern-primary:hover { background: #0d4bc1; }
.btn.modern-secondary { background: #1e293b; color: #fff; border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn.link { background: transparent; color: #2b6cb0; border: none; padding: 0; cursor: pointer; }

.field-row { margin-bottom: 14px; }
.field-row .label { display: block; margin-bottom: 6px; font-weight: 600; color: #334155; }

.auth-cta { display: flex; gap: 12px; align-items: center; }
.auth-cta .spacer { flex: 1; }

/* Responsive auth-cta */
@media (max-width: 768px) {
  .auth-cta { 
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .auth-cta .spacer { 
    display: none; 
  }
}

@media (max-width: 480px) {
  .auth-cta { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 4px;
  }
  
  .auth-cta span {
    display: block;
    width: 100%;
    margin-bottom: 2px;
    font-size: 14px;
  }
  
  .auth-cta a {
    width: 100%;
    text-align: center;
    display: block;
    padding: 8px;
  }
  
  .auth-cta .btn.link {
    width: 100%;
    text-align: center;
    padding: 6px 0;
    font-size: 14px;
  }
  
  .auth-footer .auth-cta {
    gap: 2px;
  }
  
  .auth-footer .auth-cta span {
    margin-bottom: 2px;
  }
}

.note { font-size: 13px; color: #64748b; display: flex; gap: 8px; align-items: flex-start; }
.note i { margin-top: 3px; }

/* General form field fallback styling for existing classes */
input.w100p, input.w100, input.w200, input.w400 { border-radius: 8px; border: 1px solid #e2e8f0; }
select, .form-select { border-radius: 8px; }


/* Modernize large signup form fields without changing markup */
.form-field { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.form-field.border-top { border-top: 1px solid #f1f5f9; }
.form-field dt { margin: 0; font-weight: 700; color: #334155; }
.form-field dd { margin: 0; }
.form-field dd input[type="text"],
.form-field dd input[type="password"],
.form-field dd input[type="tel"],
.form-field dd input[type="email"],
.form-field dd textarea { width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; outline: none; transition: box-shadow .2s, border-color .2s; }
.form-field dd textarea { min-height: 90px; }
.form-field dd select,
.form-field dd .form-select { width: 100%; }
.form-field dd input:focus,
.form-field dd textarea:focus,
.form-field dd select:focus { border-color: #3182ce; box-shadow: 0 0 0 4px rgba(49,130,206,0.15); }

@media (max-width: 700px) {
  .form-field { grid-template-columns: 1fr; }
}

/* Stack labels above inputs for the large signup card */
.auth-card--wide .form-field { grid-template-columns: 1fr; align-items: start; }
.auth-card--wide .inline-triplet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.auth-card--wide .form-field dt { margin: 0 0 6px 0; }
.auth-card--wide .form-field dd { display: grid; gap: 10px; }

/* Make legacy .btn.red look modern to match primary */
.btn.red { background: #0d4bc1; color: #fff !important; border: none; padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.btn.red:hover { background: #be123c; }

/* Utility widths inside forms */
.auth-card--wide .w200 { max-width: 320px; width: 100%; }
.auth-card--wide .w400 { max-width: 520px; width: 100%; }

/* Inline duo layout for Phone (country code + number) */
.auth-card--wide .inline-duo { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: 12px; align-items: start; }
@media (max-width: 700px) { .auth-card--wide .inline-duo { grid-template-columns: 1fr; } }

/* Responsive inline-triplet for name fields */
@media (max-width: 600px) {
  .auth-card--wide .inline-triplet { 
    grid-template-columns: 1fr; 
    gap: 10px;
  }
}

/* Additional responsive improvements for tablets */
@media (max-width: 900px) and (min-width: 481px) {
  .auth-card--wide {
    max-width: 100%;
  }
  
  .auth-card--wide .form-field {
    padding: 16px 0;
  }
}

/* Responsive form fields */
@media (max-width: 480px) {
  .form-field { 
    padding: 12px 0; 
  }
  
  .form-field dt { 
    font-size: 14px; 
    margin-bottom: 8px;
  }
  
  .field-row { 
    margin-bottom: 16px; 
  }
  
  .field-row .label { 
    font-size: 14px; 
    margin-bottom: 8px;
  }
  
  .note { 
    font-size: 12px; 
    line-height: 1.5;
  }
  
  .auth-help { 
    font-size: 13px;
    gap: 4px !important;
  }
  
  .auth-help a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0; /* Further reduced padding */
    min-height: 36px; /* Reduced for less gap */
  }
  
  .auth-footer .auth-help a {
    padding: 3px 0; /* Even less padding in footer */
    min-height: 32px;
  }
  
  .auth-help i {
    font-size: 12px;
  }
  
  .auth-help li {
    margin: 0 !important;
  }
  
  /* Touch-friendly buttons */
  .btn.modern-primary,
  .btn.modern-secondary,
  .btn.link {
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Better spacing for wide cards on mobile */
  .auth-card--wide .form-field {
    padding: 16px 0;
  }
  
  .auth-card--wide .form-field dt {
    font-size: 14px;
  }
}


.form-select div button {
  background: #fff !important;
  color: #222 !important;
}

.form-select div button:hover
 {
    color: black !important;
}

/* Additional mobile optimizations for login page */
@media (max-width: 480px) {
  /* Ensure form elements don't overflow */
  .auth-body form {
    width: 100%;
    max-width: 100%;
  }
  
  /* Better spacing for forgot password link */
  .auth-body .auth-cta {
    margin-top: 12px;
  }
  
  /* Ensure help links are properly sized */
  .auth-footer .auth-help li {
    margin-bottom: 8px;
  }
  
  /* Make sure icons don't cause layout issues */
  .auth-header i,
  .input-group > i,
  .auth-help a i {
    flex-shrink: 0;
  }
}

/* Ensure proper viewport behavior */
@media (max-width: 768px) {
  .auth-container {
    -webkit-overflow-scrolling: touch;
  }
  
  .auth-card {
    -webkit-transform: translateZ(0); /* Force hardware acceleration */
  }
}

/* Ensure Font Awesome icons display correctly */
.fa-solid,
.fa-regular,
.fa-brands,
[class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
  display: inline-block !important;
}

.fa-regular {
  font-weight: 400 !important;
}

.fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

/* Ensure icons in auth pages are visible */
.auth-header i,
.auth-body i,
.auth-footer i,
.input-group > i,
.auth-cta i,
.auth-help i {
  display: inline-block !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
}