/* ========================================
   FORMS + SINGLE GLOBAL SELECT2 THEME
======================================== */
.hp-form label,
.hp-form .hp-field__label,
.hp-form .hp-form__label {
  color: var(--ribo-text);
}

.hp-form :is(
  .hp-field__description,
  .hp-form__description,
  small,
  .optional
) {
  color: rgba(255, 255, 255, .62);
}

.hp-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.hp-form textarea,
.hp-form select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(34, 197, 94, .24);
  border-radius: 10px;
  box-shadow: none;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  outline: 0;
}

.hp-form textarea {
  min-height: 140px;
  resize: vertical;
}

.hp-form input::placeholder,
.hp-form textarea::placeholder {
  color: rgba(255, 255, 255, .5);
  -webkit-text-fill-color: rgba(255, 255, 255, .5);
  opacity: 1;
}

.hp-form input:not([type="checkbox"]):not([type="radio"]):focus,
.hp-form textarea:focus,
.hp-form select:focus {
  background: rgba(255, 255, 255, .1);
  border-color: var(--ribo-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}

.hp-form select option {
  background: var(--ribo-card);
  color: var(--ribo-text);
}

/* Chrome autofill, including Location. */
.hp-form input:-webkit-autofill,
.hp-form input:-webkit-autofill:hover,
.hp-form input:-webkit-autofill:focus {
  border-color: var(--ribo-green) !important;
  box-shadow: 0 0 0 1000px #17211c inset !important;
  -webkit-box-shadow: 0 0 0 1000px #17211c inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  transition: background-color 9999s ease-out 0s;
}

/* Native checkboxes only: no generated duplicate marks. */
.hp-form .hp-field--checkbox,
.hp-form .hp-form__field--checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ribo-text);
  cursor: pointer;
}

.hp-form .hp-form__field--checkbox label::before,
.hp-form .hp-form__field--checkbox label::after,
.hp-form .hp-field--checkbox span::before,
.hp-form .hp-field--checkbox span::after {
  display: none !important;
  content: none !important;
}

.hp-form input[type="checkbox"],
.hp-form .hp-form__field--checkbox input[type="checkbox"] {
  position: static !important;
  display: inline-block !important;
  flex: 0 0 20px;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  clip: auto !important;
  clip-path: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  accent-color: var(--ribo-green);
  pointer-events: auto !important;
}

.hp-form input[type="radio"] {
  accent-color: var(--ribo-green);
}

/* WhatsApp/Viber: equal containers using the real checkbox. */
body:has(.hp-form--listing-update) .hp-form__field:has(
  input[name*="whatsapp" i],
  input[id*="whatsapp" i],
  input[name*="viber" i],
  input[id*="viber" i]
) > .hp-form__label {
  display: none;
}

body:has(.hp-form--listing-update) .hp-form__field:has(
  input[name*="whatsapp" i],
  input[id*="whatsapp" i],
  input[name*="viber" i],
  input[id*="viber" i]
) label {
  width: min(100%, 260px);
  min-height: 50px;
  padding: 12px 16px;
  background: rgba(34, 197, 94, .07);
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 11px;
  color: var(--ribo-text);
  font-weight: 700;
}

/* Upload. */
.hp-field--button,
.hp-field--attachment-upload button,
.hp-field--attachment-upload .button {
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .4);
  border-radius: 12px;
  color: var(--ribo-green);
}

/* Phone. */
.hp-form .iti input {
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
}

.hp-form .iti__selected-dial-code {
  color: #ffffff;
}

.hp-form .iti__arrow {
  border-top-color: #ffffff;
}

.hp-form :is(.iti__flag-container, .iti__selected-flag) {
  background: transparent;
}

/* Select2. Do not position or resize the detached dropdown container. */
.hp-form .select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  min-height: 46px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(34, 197, 94, .24);
  border-radius: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 10px 42px 10px 14px;
  color: #ffffff;
  line-height: 24px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: rgba(255, 255, 255, .5);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  right: 10px;
  height: 44px;
}

.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--ribo-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}

body > .select2-container--open {
  z-index: 99999;
}

.select2-dropdown {
  overflow: hidden;
  background: #18231d;
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.select2-container--default .select2-search--dropdown,
.select2-container--default .select2-search--dropdown[style] {
  padding: 10px;
  background: #18231d !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--dropdown input.select2-search__field {
  min-height: 38px !important;
  background: #0d1712 !important;
  border: 1px solid rgba(34, 197, 94, .35) !important;
  border-radius: 8px;
  box-shadow: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  outline: 0;
}

.select2-results,
.select2-results__options {
  background: #18231d;
}

.select2-results__option {
  padding: 10px 14px;
  background: #18231d;
  color: #ffffff;
}

.select2-results__option--highlighted,
.select2-results__option--highlighted[aria-selected] {
  background: var(--ribo-green-dark) !important;
  color: #ffffff !important;
}

.select2-results__option[aria-selected="true"] {
  background: rgba(34, 197, 94, .16);
  color: #ffffff;
}

.select2-container--default .select2-results__option:first-child,
.select2-container--default .select2-results__option[aria-disabled="true"],
.select2-container--default .select2-results__option[data-select2-id] {
  background: #18231d;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.select2-container--default .select2-results__option:first-child:hover,
.select2-container--default .select2-results__option:first-child[aria-selected="true"] {
  background: rgba(34, 197, 94, .16);
  color: #ffffff;
}


/* ========================================
   LOGIN / REGISTRACIJA MODALI
======================================== */
.fancybox-content:has(.hp-form--user-login),
.fancybox-content:has(.hp-form--user-register),
.fancybox-content:has(.hp-form--user-password-reset),
.hp-modal__content:has(.hp-form--user-login),
.hp-modal__content:has(.hp-form--user-register),
.hp-modal__content:has(.hp-form--user-password-reset) {
  width: min(92vw, 440px) !important;
  max-width: 440px !important;
  padding: 30px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 42%),
    #0d1712 !important;
  border: 1px solid rgba(34, 197, 94, .28) !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .48) !important;
}

.fancybox-content:has(.hp-form--user-login) :is(h1, h2, h3, .hp-modal__title),
.fancybox-content:has(.hp-form--user-register) :is(h1, h2, h3, .hp-modal__title),
.fancybox-content:has(.hp-form--user-password-reset) :is(h1, h2, h3, .hp-modal__title) {
  position: relative;
  margin: 0 0 22px !important;
  padding-top: 18px;
  color: #ffffff !important;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.fancybox-content:has(.hp-form--user-login) :is(h1, h2, h3, .hp-modal__title)::before,
.fancybox-content:has(.hp-form--user-register) :is(h1, h2, h3, .hp-modal__title)::before,
.fancybox-content:has(.hp-form--user-password-reset) :is(h1, h2, h3, .hp-modal__title)::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 58px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #22c55e, rgba(34, 197, 94, .68), transparent);
  border-radius: 999px;
}

.fancybox-content:has(.hp-form--user-login) .hp-form__field,
.fancybox-content:has(.hp-form--user-register) .hp-form__field,
.fancybox-content:has(.hp-form--user-password-reset) .hp-form__field {
  margin-bottom: 16px;
}

.fancybox-content:has(.hp-form--user-login) :is(a, label, p, small, span),
.fancybox-content:has(.hp-form--user-register) :is(a, label, p, small, span),
.fancybox-content:has(.hp-form--user-password-reset) :is(a, label, p, small, span) {
  color: rgba(255, 255, 255, .78);
}

.fancybox-content:has(.hp-form--user-login) a,
.fancybox-content:has(.hp-form--user-register) a,
.fancybox-content:has(.hp-form--user-password-reset) a {
  color: var(--ribo-green);
  font-weight: 700;
}

.fancybox-content:has(.hp-form--user-login) .hp-form__button,
.fancybox-content:has(.hp-form--user-register) .hp-form__button,
.fancybox-content:has(.hp-form--user-password-reset) .hp-form__button {
  width: 100%;
}

/* Gre分ke i potvrde moraju biti vidljive samo kada sadr弔e poruku. */
.hp-form__messages:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hp-form__messages:not(:empty),
.hp-form__error,
.hp-field__error,
.hp-message--error,
.hp-message--success {
  display: block;
  margin: 10px 0;
  opacity: 1;
  visibility: visible;
}

.hp-form__error,
.hp-field__error,
.hp-message--error {
  color: #fca5a5 !important;
}

.hp-message--success {
  color: #86efac !important;
}

@media (max-width: 768px) {
  .fancybox-content:has(.hp-form--user-login),
  .fancybox-content:has(.hp-form--user-register),
  .fancybox-content:has(.hp-form--user-password-reset),
  .hp-modal__content:has(.hp-form--user-login),
  .hp-modal__content:has(.hp-form--user-register),
  .hp-modal__content:has(.hp-form--user-password-reset) {
    width: calc(100vw - 28px) !important;
    padding: 24px 20px !important;
    border-radius: 16px !important;
  }
}

/* ========================================
   POTVRDA NAKON OBJAVE OGLASA
   /submit-listing/complete/
======================================== */

/* Tekst potvrde */
.hp-page__content > p {
    color: #f3f4f6;
}

/* "Vrati se na Moj račun" */
.hp-page__content
button.button[data-component="link"][data-url*="/account"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 46px !important;
    margin-top: 18px !important;
    padding: 11px 20px !important;

    background: #22c55e !important;
    border: 1px solid #22c55e !important;
    border-radius: 10px !important;

    color: #07130b !important;
    -webkit-text-fill-color: #07130b !important;

    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;

    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

/* Hover */
.hp-page__content
button.button[data-component="link"][data-url*="/account"]:hover {
    background: #4ade80 !important;
    border-color: #4ade80 !important;

    color: #07130b !important;
    -webkit-text-fill-color: #07130b !important;

    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(34, 197, 94, .18) !important;
}

/* Mobitel */
@media (max-width: 767px) {
    .hp-page__content
    button.button[data-component="link"][data-url*="/account"] {
        width: 100% !important;
    }
}

/* ========================================
   HIVEPRESS SUCCESS / ERROR PORUKE
======================================== */
.hp-form__messages.hp-form__messages--success:not(:empty) {
  margin: 14px 0 22px !important;
  padding: 14px 16px !important;
  background: rgba(34, 197, 94, .10) !important;
  border: 1px solid rgba(34, 197, 94, .38) !important;
  border-left: 4px solid var(--ribo-green) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  color: #bbf7d0 !important;
}

.hp-form__messages.hp-form__messages--success:not(:empty) > div {
  color: #bbf7d0 !important;
  font-weight: 700;
}

.hp-form__messages.hp-form__messages--success:not(:empty) > div::before {
  content: "✓";
  display: inline-block;
  margin-right: 8px;
  color: var(--ribo-green);
  font-weight: 900;
}


/* ========================================
   FINAL QA — IKONA PRIKAZA LOZINKE
======================================== */
.hp-form__field:has(input[type="password"]) :is(.hp-field__button, button, i),
.hp-form__field:has(input[type="text"][name*="password"]) :is(.hp-field__button, button, i),
.hp-field:has(input[type="password"]) :is(.hp-field__button, button, i),
.hp-field:has(input[type="text"][name*="password"]) :is(.hp-field__button, button, i) {
  color: #eaffea !important;
  -webkit-text-fill-color: #eaffea !important;
  opacity: 1 !important;
}

.hp-form__field:has(input[type="password"]) :is(.hp-field__button, button, i):hover,
.hp-form__field:has(input[type="text"][name*="password"]) :is(.hp-field__button, button, i):hover,
.hp-field:has(input[type="password"]) :is(.hp-field__button, button, i):hover,
.hp-field:has(input[type="text"][name*="password"]) :is(.hp-field__button, button, i):hover {
  color: #19D312 !important;
  -webkit-text-fill-color: #19D312 !important;
}

/* ========================================
   DODAJ / UREDI OGLAS — KOMPAKTNIJI UX + HR VALIDACIJA
   17.09.2026.
======================================== */
.hp-form--listing-submit .hp-form__field,
.hp-form--listing-update .hp-form__field {
  margin-bottom: 18px !important;
}

.hp-form--listing-submit :is(.hp-field__description, .hp-form__description),
.hp-form--listing-update :is(.hp-field__description, .hp-form__description) {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}

.hp-form--listing-submit :is(.hp-field__label, .hp-form__label),
.hp-form--listing-update :is(.hp-field__label, .hp-form__label) {
  margin-bottom: 7px !important;
}

.ribo-has-field-error input:not([type="checkbox"]):not([type="radio"]),
.ribo-has-field-error textarea,
.ribo-has-field-error select,
.ribo-has-field-error .select2-selection {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, .12) !important;
}

.ribo-field-error {
  margin-top: 7px;
  color: #ff9a9a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 767px) {
  .hp-form--listing-submit .hp-form__field,
  .hp-form--listing-update .hp-form__field {
    margin-bottom: 15px !important;
  }
}


/* ==========================================================================
   RIBOLOVNO.HR — STABILNO VIZUALNO GRUPIRANJE POLJA OGLASA
   CSS-only. Ne dira DOM, validaciju, AJAX niti redoslijed polja.
   ========================================================================== */

.hp-form--listing-submit > .hp-form__fields,
.hp-form--listing-update > .hp-form__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field,
.hp-form--listing-update > .hp-form__fields > .hp-form__field {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(
  input[name="kontakt"],
  input[name="telefon"],
  input[name="phone"],
  input[name="contact_phone"],
  input[type="tel"]
),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(
  input[name="kontakt"],
  input[name="telefon"],
  input[name="phone"],
  input[name="contact_phone"],
  input[type="tel"]
) {
  grid-column: 1;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(
  input[name="email"],
  input[name="contact_email"],
  input[type="email"]
),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(
  input[name="email"],
  input[name="contact_email"],
  input[type="email"]
) {
  grid-column: 2;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(input[name*="whatsapp" i]),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(input[name*="whatsapp" i]) {
  grid-column: 1;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(input[name*="viber" i]),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(input[name*="viber" i]) {
  grid-column: 2;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(input[name="dostava"], select[name="dostava"]),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(input[name="dostava"], select[name="dostava"]) {
  grid-column: 1;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(input[name="zamjena"], select[name="zamjena"]),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(input[name="zamjena"], select[name="zamjena"]) {
  grid-column: 2;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(
  input[name="kontakt"],
  input[name="telefon"],
  input[name="phone"],
  input[name="contact_phone"],
  input[type="tel"],
  input[name="email"],
  input[name="contact_email"],
  input[type="email"]
),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(
  input[name="kontakt"],
  input[name="telefon"],
  input[name="phone"],
  input[name="contact_phone"],
  input[type="tel"],
  input[name="email"],
  input[name="contact_email"],
  input[type="email"]
) {
  padding: 13px 14px;
  background: rgba(34, 197, 94, .045);
  border: 1px solid rgba(34, 197, 94, .22);
  border-radius: 11px;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(
  input[name*="whatsapp" i],
  input[name*="viber" i],
  input[name="dostava"],
  input[name="zamjena"],
  select[name="dostava"],
  select[name="zamjena"]
),
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(
  input[name*="whatsapp" i],
  input[name*="viber" i],
  input[name="dostava"],
  input[name="zamjena"],
  select[name="dostava"],
  select[name="zamjena"]
) {
  min-width: 0;
  padding: 12px 14px;
  background: rgba(34, 197, 94, .045);
  border: 1px solid rgba(34, 197, 94, .22);
  border-radius: 11px;
  box-sizing: border-box;
}

.hp-form--listing-submit > .hp-form__fields > .hp-form__field:has(
  input[name*="whatsapp" i],
  input[name*="viber" i]
) label,
.hp-form--listing-update > .hp-form__fields > .hp-form__field:has(
  input[name*="whatsapp" i],
  input[name*="viber" i]
) label {
  width: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

@media (max-width: 699px) {
  .hp-form--listing-submit > .hp-form__fields,
  .hp-form--listing-update > .hp-form__fields {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .hp-form--listing-submit > .hp-form__fields > .hp-form__field,
  .hp-form--listing-update > .hp-form__fields > .hp-form__field {
    grid-column: 1 !important;
  }
}


/* ==========================================================================
   RIBOLOVNO.HR — PARTNER PRICE ROW FULL WIDTH
   Naš grid forme ne smije stisnuti partnerski red "Način prodaje + cijena".
   Unutarnji raspored tog reda i dalje u potpunosti kontrolira Partner plugin.
   ========================================================================== */
.hp-form--listing-submit > .hp-form__fields > .rib-partner-price-row,
.hp-form--listing-update > .hp-form__fields > .rib-partner-price-row {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0;
}


/* ========================================
   LOGIN / REGISTRACIJA — FALLBACK BEZ :has()
   Neki preglednici / modal inicijalizacije ne primijene :has() dovoljno rano.
   Zato ciljamo točne HivePress modal ID-eve.
======================================== */
#user_login_modal.hp-modal.fancybox-content,
#user_register_modal.hp-modal.fancybox-content,
#user_password_request_modal.hp-modal.fancybox-content,
#user_login_modal .hp-modal__content,
#user_register_modal .hp-modal__content,
#user_password_request_modal .hp-modal__content {
  background: #0d1712 !important;
  color: #ffffff !important;
  border: 1px solid rgba(34, 197, 94, .28) !important;
}

#user_login_modal :is(h1, h2, h3, .hp-modal__title, label, p, small, span),
#user_register_modal :is(h1, h2, h3, .hp-modal__title, label, p, small, span),
#user_password_request_modal :is(h1, h2, h3, .hp-modal__title, label, p, small, span) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

#user_login_modal a,
#user_register_modal a,
#user_password_request_modal a {
  color: var(--ribo-green) !important;
  -webkit-text-fill-color: var(--ribo-green) !important;
}
