/*
  Responsive polish for the public website.
  This file is loaded last so it can normalize older page rules safely.
*/

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  position: relative;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

html:not(.js-reveal-enabled) [data-reveal] {
  opacity: 1;
  transform: none;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.container,
.main-content,
.section,
.hero,
.glass-card,
.content-card,
.filter-card,
.auth-wrap,
.account-select-wrap,
.detail-main,
.detail-sidebar {
  min-width: 0;
}

.header-inner {
  width: 100%;
}

.logo-new .logo-img-rabt {
  width: auto;
  max-width: clamp(116px, 18vw, 220px);
}

.mobile-menu {
  max-height: calc(100vh - 78px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu > a,
.mobile-actions .btn {
  min-height: var(--touch-min, 44px);
}

.mobile-actions .btn,
.auth-wrap .btn,
.account-select-card .btn,
.form-actions .btn,
.card-actions-row .btn,
.card-actions-row .btn-card-action {
  white-space: normal;
  line-height: 1.35;
}

.cards-grid,
.cards-grid--list,
.cards-grid--3col,
.solution-cards-grid,
.opportunities-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.content-card,
.glass-card {
  overflow-wrap: break-word;
}

.form-input,
.form-select,
.form-textarea,
.search-input,
.filter-form input,
.filter-form select,
.filter-form textarea,
.unified-dropdown-display,
.custom-select-display {
  min-width: 0;
  max-width: 100%;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  min-width: 0;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"].password-field {
  padding-left: 52px !important;
}

.password-toggle-btn {
  position: absolute;
  left: 12px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  z-index: 2;
}

.password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.form-block__file-label,
.form-block__file-text,
.form-block__file-specs,
.form-help-text,
.form-error,
.alert,
.message-alert,
.message-text,
.footer-text,
.footer-desc {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-block__file-specs {
  display: block;
  max-width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.table-responsive,
.overflow-x-auto,
.dashboard-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1100px) {
  .header-inner {
    gap: 10px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-link {
    padding-inline: 6px;
    font-size: 14px;
  }

  .header-actions .btn {
    padding-inline: 16px;
  }
}

@media (max-width: 900px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    height: 78px;
  }

  .header-actions > .btn,
  .header-actions > span.btn {
    display: none;
  }

  .header-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .nav-toggle {
    border-radius: 10px;
  }

  .mobile-menu {
    padding-block: 10px 16px;
    border-top-color: rgba(47, 128, 237, 0.12);
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  }

  .mobile-menu > a {
    padding: 12px 4px;
    border-bottom: 1px solid rgba(47, 128, 237, 0.08);
  }

  .mobile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .mobile-actions .btn {
    width: 100%;
    text-decoration: none !important;
    min-height: 48px !important;
    padding: 13px 24px !important;
    line-height: 1.5 !important;
  }

  .mobile-actions .btn-primary {
    color: #ffffff !important;
    background: linear-gradient(180deg, #3b8bf5 0%, #2568d4 100%) !important;
  }

  .mobile-actions .btn-glass {
    color: var(--primary) !important;
    background: #ffffff !important;
    border: 1px solid var(--primary) !important;
  }

  .main-content--with-header {
    padding-top: 0;
  }

  .section,
  .section.slim,
  .hero,
  .section-hero-list,
  .hero-section-page,
  .form-page-section,
  .page-top-padding {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .hero-home {
    padding-top: 44px !important;
  }

  .auth-wrap,
  .auth-wrap--narrow,
  .auth-wrap--wide {
    width: 100%;
    max-width: 680px;
  }

  .auth-head {
    margin-bottom: 24px;
  }

  .auth-head .section-title,
  .section-title,
  .page-title .section-title,
  .page-title__heading,
  .hero-title,
  .hero-title-page {
    font-size: clamp(22px, 5vw, 28px) !important;
    line-height: 1.35;
  }

  .hero-desc,
  .hero-home .hero-desc,
  .section-subtitle,
  .auth-intro__desc,
  .page-subtitle,
  .page-title .section-subtitle {
    font-size: 15px;
    line-height: 1.75;
  }

  .form-row,
  .grid-cols-2,
  .profile-header-grid,
  .detail-layout,
  .talent-detail-layout {
    grid-template-columns: 1fr !important;
  }

  .filter-form.filter-form-unified,
  .filter-form--inline,
  .search-row {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .filter-form.filter-form-unified > *,
  .filter-form.filter-form-unified .filter-form__search-wrap,
  .filter-form.filter-form-unified select.form-select,
  .filter-form.filter-form-unified .unified-dropdown-wrapper,
  .filter-form--inline .form-input,
  .filter-form--inline .btn,
  .search-row .search-input,
  .search-row .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto !important;
  }

  .filter-form.filter-form-unified .filter-form__clear {
    width: 100%;
    margin-inline-start: 0;
    text-align: center;
  }

  .card-actions-row,
  .meta-row,
  .talent-detail-section-head,
  .pagination-wrap,
  .pagination-row,
  .auth-result-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px !important;
  }

  .header-inner {
    padding-inline: 14px !important;
  }

  .logo-new .logo-img-rabt,
  .logo-img {
    height: 48px !important;
    width: 132px;
    max-width: 132px;
    object-fit: contain;
  }

  .nav-toggle {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .glass-card,
  .content-card,
  .filter-card,
  .solution-cards-section,
  .talent-detail-page .talent-detail-card,
  .contact-page__card,
  .contact-page__info-card {
    padding: 18px 16px !important;
    border-radius: 14px;
  }

  .auth-wrap .glass-card {
    padding: 22px 18px !important;
  }

  .form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
  }

  .form-section-title {
    font-size: 17px;
    line-height: 1.5;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-input,
  .form-select,
  .form-textarea,
  input[type="password"],
  input[type="password"].form-input,
  .password-input-wrapper input[type="text"].password-field,
  input[type="text"][id*="password"],
  .search-input,
  .custom-select-display,
  .unified-dropdown-display {
    min-height: 48px;
    font-size: 16px !important;
  }

  .password-requirements,
  .password-match-indicator {
    font-size: 13px;
    line-height: 1.6;
  }

  .form-block__file-label {
    min-height: 136px;
    padding: 20px 14px;
  }

  .form-block__file-icon svg {
    width: 30px;
    height: 30px;
  }

  .account-select-hero {
    margin: 28px auto 24px;
    padding-inline: 16px;
  }

  .account-select-hero h1 {
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.35;
  }

  .account-select-cards {
    grid-template-columns: 1fr;
    padding-inline: 16px;
    margin-bottom: 36px;
  }

  .account-select-card {
    padding: 24px 18px;
  }

  .account-select-card .icon {
    font-size: 44px;
    margin-bottom: 14px;
  }

  .account-select-footer {
    padding-inline: 16px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-title br {
    display: none;
  }

  .hero-title,
  .hero-title-page {
    font-size: 22px !important;
    line-height: 1.45;
    max-width: 340px;
    margin-inline: auto;
    padding-inline: 4px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: balance;
  }

  .hero-actions .btn,
  .section-head .btn-glass,
  .section-head .btn-ghost,
  .card-actions-row .btn,
  .card-actions-row .btn-card-action,
  .btn--flex,
  .contact-page__submit,
  .detail-main form.inline,
  .detail-main form.inline .btn,
  .detail-sidebar .btn,
  .solution-card .btn,
  .form-block__field .btn,
  a.btn[download] {
    width: 100%;
  }

  a.btn[download],
  .w-fit {
    width: 100% !important;
    justify-content: center;
  }

  .provider-card,
  .talent-detail-header {
    align-items: stretch;
  }

  .provider-card__logo,
  .provider-card__logo-placeholder {
    width: 64px;
    height: 64px;
  }

  .messages-container {
    top: 82px;
    right: 12px;
    left: 12px;
  }

  .message-alert {
    align-items: flex-start;
    padding: 13px 14px;
  }

  .footer {
    margin-top: 36px;
  }
}

@media (max-width: 380px) {
  .container {
    padding-inline: 12px !important;
  }

  .header-inner {
    height: 70px;
    padding-inline: 12px !important;
  }

  .logo-new .logo-img-rabt,
  .logo-img {
    height: 42px !important;
    width: 116px;
    max-width: 116px;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 20px;
  }

  .mobile-menu {
    max-height: calc(100vh - 70px);
  }

  .section,
  .section.slim,
  .hero,
  .section-hero-list,
  .hero-section-page,
  .form-page-section,
  .page-top-padding {
    padding-top: 36px !important;
    padding-bottom: 40px !important;
  }

  .auth-wrap .glass-card,
  .glass-card,
  .content-card,
  .filter-card {
    padding: 16px 14px !important;
  }

  .btn {
    padding-inline: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
