/* Korisnički portal (prijava, registracija, upit za događaj) */
.app-portal-wrap {
  margin: 0 auto;
  padding: 0 5% 80px;
  position: relative;
  z-index: 2;
  max-width: 540px;
  width: 100%;
  box-sizing: border-box;
}

.app-portal-hero {
  text-align: center;
  padding: 40px 5% 24px;
  position: relative;
  box-sizing: border-box;
}

.app-portal-lead {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.98rem !important;
  line-height: 1.65 !important;
  max-width: 28rem !important;
  font-weight: 500;
}

.app-portal-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
  line-height: 1.1;
}

.app-portal-hero p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 42rem;
  margin: 0 auto;
}

.app-portal-card {
  position: relative;
  border-radius: 20px;
  padding: 28px 24px 32px;
  background: linear-gradient(145deg, rgba(22, 24, 32, 0.94), rgba(10, 11, 16, 0.92));
  border: 1px solid rgba(255, 204, 0, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(255, 204, 0, 0.06);
  overflow: hidden;
  animation: appCardEnter 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-portal-card::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 200deg, transparent 40%, rgba(255, 204, 0, 0.07), transparent 62%);
  animation: appCardAura 14s linear infinite;
  pointer-events: none;
}

@keyframes appCardEnter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appCardAura {
  to {
    transform: rotate(360deg);
  }
}

.app-portal-card-inner {
  position: relative;
  z-index: 1;
}

.app-form label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 204, 0, 0.85);
  margin: 16px 0 8px;
}

.app-form label:first-of-type {
  margin-top: 0;
}

.app-form input,
.app-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  /* 16px+ sprječava iOS auto-zoom pri fokusu */
  font-size: max(16px, 1rem);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.app-form input:focus,
.app-form textarea:focus {
  outline: none;
  border-color: rgba(255, 204, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12);
}

.app-form textarea {
  min-height: 120px;
  resize: vertical;
}

.app-form-msg {
  margin-top: 16px;
  min-height: 0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-form-msg:empty {
  display: none;
}

.app-form-msg.is-ok {
  color: rgba(160, 210, 160, 0.95);
}

.app-form-msg.is-error {
  color: #e8a0a0;
}

.app-form.is-loading .app-btn-primary {
  opacity: 0.65;
  pointer-events: none;
}

.app-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.app-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: #0a0a0a;
  background: linear-gradient(120deg, #ffe566, var(--main), #fff3a0);
  box-shadow: 0 8px 28px rgba(255, 204, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.app-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(255, 204, 0, 0.45);
}

.app-links {
  margin-top: 20px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.55);
}

.app-links a {
  color: var(--main);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 204, 0, 0.35);
}

.app-links a:hover {
  border-bottom-color: var(--main);
}

.app-narudzba-wide {
  max-width: 880px;
}

.app-user-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-user-bar span {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

.app-btn-ghost {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-btn-ghost:hover {
  border-color: rgba(255, 204, 0, 0.5);
  color: var(--main);
}

.app-bookings-list {
  margin-top: 28px;
}

.app-bookings-list h2 {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.75);
}

.app-package-prefill {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.2);
}

.app-package-prefill__label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4cd57;
  margin-bottom: 8px;
}

.app-package-prefill__title {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.94);
}

.app-package-prefill__text {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
}

.app-booking-card {
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  animation: appCardEnter 0.55s ease both;
}

.app-booking-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.app-booking-date {
  margin-top: 0;
}

.app-booking-package {
  margin: 0 0 8px;
  color: #f4cd57;
  font-weight: 700;
}

.app-booking-desc {
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  margin: 8px 0 0;
}

.app-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-badge--pending {
  background: rgba(255, 200, 80, 0.18);
  color: #ffd566;
  border: 1px solid rgba(255, 200, 80, 0.35);
}

.app-badge--approved {
  background: rgba(80, 220, 120, 0.15);
  color: #8ef0a8;
  border: 1px solid rgba(80, 220, 120, 0.35);
}

.app-badge--rejected {
  background: rgba(255, 100, 100, 0.12);
  color: #ff9a9a;
  border: 1px solid rgba(255, 100, 100, 0.3);
}

.app-muted {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
}

.app-guest-panel {
  text-align: center;
  padding: 24px 12px 8px;
}

.app-guest-panel .btn-main {
  margin: 8px 6px;
  display: inline-block;
}

body.app-portal-login .app-portal-wrap,
body.app-portal-register .app-portal-wrap {
  max-width: 560px;
}

body.app-portal-book .app-portal-wrap.app-narudzba-wide {
  max-width: 640px;
}

.app-portal-card--xl {
  padding-top: 32px;
}

.app-form--register .app-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 560px) {
  .app-form--register .app-form-grid {
    grid-template-columns: 1fr;
  }
}

.app-label-opt {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: none;
  letter-spacing: 0.02em;
}

.app-field-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.4;
}

.app-password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.app-password-wrap input {
  padding-right: 52px !important;
}

.app-btn-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 204, 0, 0.12);
  color: var(--main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, box-shadow 0.2s;
}

.app-btn-toggle-pw:hover {
  background: rgba(255, 204, 0, 0.22);
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.2);
}

.app-btn-toggle-pw:focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}

/* Naslov — jači „impact“ */
@media (prefers-reduced-motion: no-preference) {
  body.app-portal-page .app-portal-titlefx {
    background: linear-gradient(110deg, #fff 0%, #fff7c2 25%, var(--main) 45%, #ffe566 65%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: appTitleShimmer 3.5s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 28px rgba(255, 204, 0, 0.35));
  }

  @keyframes appTitleShimmer {
    0%,
    100% {
      background-position: 0% center;
    }
    50% {
      background-position: 100% center;
    }
  }

  body.app-portal-register .app-portal-card::before {
    animation-duration: 7s !important;
    opacity: 1;
    background: conic-gradient(from 120deg, transparent 30%, rgba(255, 204, 0, 0.14), transparent 55%, rgba(255, 100, 200, 0.06), transparent 78%);
  }

  body.app-portal-register .app-portal-card {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 24px 56px rgba(0, 0, 0, 0.55),
      0 0 60px rgba(255, 204, 0, 0.06);
    animation: appCardEnter 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-portal-card,
  .app-booking-card,
  .app-portal-card::before {
    animation: none !important;
  }
  body.app-portal-page .app-portal-titlefx {
    -webkit-text-fill-color: #fff;
    background: none;
  }
}

/* Mobilni uređaji: ista vizuelna hijerarhija kao na desktopu, bez horizontalnog pomicanja */
@media (max-width: 600px) {
  body.app-portal-page .app-portal-wrap {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .app-portal-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-portal-lead {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
  }

  .app-btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .app-btn-row .app-btn-primary {
    width: 100%;
  }

  .app-links {
    font-size: 0.9rem;
    line-height: 1.55;
    word-break: break-word;
  }

  .app-password-wrap input {
    padding-right: 50px !important;
  }

  .app-btn-toggle-pw {
    width: 44px;
    height: 44px;
    right: 4px;
  }
}

@media (max-width: 380px) {
  .app-portal-card {
    border-radius: 16px;
  }

  .app-form label {
    font-size: 0.68rem;
  }
}

/* Manje animacija na mobitelu — glađe skrolovanje i manje „štucanja“ na registraciji/prijavi */
@media (max-width: 900px) {
  body.app-portal-page .app-portal-card {
    animation: none !important;
    contain: layout style paint;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.05) inset,
      0 14px 36px rgba(0, 0, 0, 0.5) !important;
  }
  body.app-portal-page .app-portal-card::before {
    display: none !important;
    content: none !important;
  }
  body.app-portal-page .app-portal-titlefx {
    animation: none !important;
    filter: none !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
  }
  body.app-portal-page .app-btn-primary {
    touch-action: manipulation;
  }
}
