/* AgriPricePH — Public alert modals */

.public-alert-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.public-alert-root.is-open {
  display: flex;
  pointer-events: auto;
}

.public-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 33, 23, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.public-alert-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2EAE4);
  border-radius: var(--border-radius-xl, 20px);
  padding: 24px 24px 20px;
  text-align: left;
  box-shadow: 0 24px 56px rgba(21, 55, 35, 0.22), 0 6px 16px rgba(21, 55, 35, 0.1);
  animation: publicAlertIn 0.22s ease;
}

@keyframes publicAlertIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.public-alert-x {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border: none; border-radius: 99px;
  background: transparent; color: var(--text-muted, #849C8E);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.public-alert-x:hover { background: var(--bg-input, #F4F6F3); color: var(--text-primary, #1C2B1E); }

.public-alert-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding-right: 26px;
}

.public-alert-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--border-radius, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-alert-icon svg {
  width: 18px;
  height: 18px;
}

.public-alert--success .public-alert-icon {
  background: rgba(82, 176, 122, 0.15);
  color: #2a5c3f;
}

.public-alert--invalid .public-alert-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.public-alert--error .public-alert-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.public-alert--warning .public-alert-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.public-alert-title {
  font-family: 'Fraunces', 'Plus Jakarta Sans', system-ui, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f1e14);
  margin: 0;
}

/* Indented to align under the title (past the icon), not under the icon —
   the small deliberate offset is what keeps this from reading as a plain
   centered icon/title/text/button stack. */
.public-alert-message {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary, #3a5045);
  margin: 0 0 22px;
  padding-left: 48px;
}

.public-alert-actions {
  display: flex;
  justify-content: flex-end;
}

.public-alert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 22px;
  border: none;
  border-radius: var(--border-radius-sm, 8px);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent, #2a5c3f);
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.public-alert-btn:hover {
  background: var(--color-accent-hover, #357350);
  transform: translateY(-1px);
}

.public-alert--invalid .public-alert-btn {
  background: #b45309;
}

.public-alert--invalid .public-alert-btn:hover {
  background: #d97706;
}

.public-alert--error .public-alert-btn {
  background: var(--color-danger, #b91c1c);
}

.public-alert--error .public-alert-btn:hover {
  background: #dc2626;
}

.public-alert--warning .public-alert-btn {
  background: #1d4ed8;
}

.public-alert--warning .public-alert-btn:hover {
  background: #2563eb;
}

@media (max-width: 420px) {
  .public-alert-message { padding-left: 0; }
}

body.public-alert-open {
  overflow: hidden;
}

/* ===== Sign-in / sign-up success (PublicAlert.celebrate) ===== */
.hello-root {
  position: fixed; inset: 0; z-index: 10020;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.hello-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(45, 90, 62, 0.45), rgba(10, 26, 18, 0.62) 70%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 300ms ease;
}
.hello-root.is-open .hello-backdrop { opacity: 1; }
.hello-card {
  position: relative; z-index: 1; width: min(360px, 100%);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2EAE4);
  border-radius: 24px; padding: 30px 26px 0; text-align: center; overflow: hidden;
  box-shadow: 0 30px 70px rgba(8, 34, 18, 0.3), 0 8px 18px rgba(8, 34, 18, 0.12);
  opacity: 0; transform: translateY(22px) scale(0.94);
  transition: opacity 280ms ease, transform 460ms cubic-bezier(.22, 1, .36, 1);
}
.hello-root.is-open .hello-card { opacity: 1; transform: none; }
.hello-root.is-leaving .hello-card { opacity: 0; transform: translateY(-10px) scale(0.97); transition-duration: 240ms; }
.hello-root.is-leaving .hello-backdrop { opacity: 0; }
.hello-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 110px;
  background: linear-gradient(180deg, var(--color-accent-light, rgba(76, 175, 110, 0.12)), transparent);
  pointer-events: none;
}

.hello-stage { position: relative; width: 120px; height: 120px; margin: 0 auto 16px; }
.hello-glow {
  position: absolute; inset: 10px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 175, 110, 0.35), transparent 70%);
  transform: scale(0.6); opacity: 0;
}
.hello-root.is-open .hello-glow { animation: hello-glow 1.6s 500ms ease-out forwards; }
.hello-ring { position: absolute; inset: 0; width: 120px; height: 120px; transform: rotate(-90deg); }
.hello-ring circle { fill: none; stroke-width: 5; }
.hello-ring-track { stroke: var(--border-color, #E2EAE4); }
.hello-ring-fill {
  stroke: var(--color-accent, #4CAF6E); stroke-linecap: round;
  stroke-dasharray: 339.3; stroke-dashoffset: 339.3;
}
.hello-root.is-open .hello-ring-fill { animation: hello-ring 720ms 160ms cubic-bezier(.65, 0, .35, 1) forwards; }
.hello-avatar {
  position: absolute; inset: 13px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(145deg, var(--color-primary-mid, #2D5A3E), var(--color-accent, #4CAF6E));
  color: #fff; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 30px; font-weight: 700;
  transform: scale(0.7); opacity: 0;
}
.hello-root.is-open .hello-avatar { animation: hello-pop 520ms 120ms cubic-bezier(.34, 1.56, .64, 1) forwards; }
.hello-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello-check {
  position: absolute; right: 2px; bottom: 4px; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent, #4CAF6E); color: #fff;
  border: 3px solid var(--bg-card, #fff); box-shadow: 0 4px 10px rgba(8, 34, 18, 0.25);
  transform: scale(0); 
}
.hello-check svg { width: 16px; height: 16px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.hello-root.is-open .hello-check { animation: hello-pop 420ms 760ms cubic-bezier(.34, 1.56, .64, 1) forwards; }
.hello-root.is-open .hello-check svg { animation: hello-draw 360ms 980ms ease-out forwards; }
.hello-burst { position: absolute; inset: 0; pointer-events: none; }
.hello-burst i {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 11px; margin: -5.5px 0 0 -2.5px;
  border-radius: 50%; background: var(--c); opacity: 0;
  transform: rotate(var(--a)) translateY(-34px) scale(0.4);
}
.hello-root.is-open .hello-burst i { animation: hello-burst 1s 820ms cubic-bezier(.2, .7, .3, 1) forwards; }

.hello-eyebrow {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--color-accent-hover, #3D9E5F); background: var(--color-accent-light, rgba(76, 175, 110, 0.12));
  padding: 4px 12px; border-radius: 999px;
}
.hello-title {
  font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
  font-size: 24px; line-height: 1.2; font-weight: 700; color: var(--text-primary, #1C2B1E);
  margin: 10px 0 6px;
}
.hello-sub { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary, #5A7060); }
.hello-role {
  display: table; margin: 10px auto 0; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.14); color: #B45309;
}
html.theme-dark .hello-role { color: #F5C069; }
.hello-eyebrow, .hello-title, .hello-sub, .hello-role, .hello-btn { opacity: 0; transform: translateY(8px); }
.hello-root.is-open .hello-eyebrow { animation: hello-up 380ms 380ms ease-out forwards; }
.hello-root.is-open .hello-title { animation: hello-up 380ms 460ms ease-out forwards; }
.hello-root.is-open .hello-sub, .hello-root.is-open .hello-role { animation: hello-up 380ms 540ms ease-out forwards; }
.hello-root.is-open .hello-btn { animation: hello-up 380ms 620ms ease-out forwards; }

.hello-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 20px 0 22px;
  height: 40px; padding: 0 22px; border: none; border-radius: 999px; cursor: pointer;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 13.5px; font-weight: 700;
  color: #fff; background: var(--color-accent, #4CAF6E);
  box-shadow: 0 8px 18px rgba(76, 175, 110, 0.32);
  transition: background 160ms ease, box-shadow 160ms ease;
}
.hello-btn svg { width: 15px; height: 15px; transition: transform 160ms ease; }
.hello-btn:hover { background: var(--color-accent-hover, #3D9E5F); }
.hello-btn:hover svg { transform: translateX(3px); }
.hello-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--border-color, #E2EAE4); }
.hello-progress span { display: block; height: 100%; width: 0; background: var(--color-accent, #4CAF6E); }
.hello-root.is-open .hello-progress span { animation-name: hello-fill; animation-timing-function: linear; animation-fill-mode: forwards; animation-delay: 600ms; }

@keyframes hello-ring { to { stroke-dashoffset: 0; } }
@keyframes hello-pop { to { transform: scale(1); opacity: 1; } }
@keyframes hello-draw { to { stroke-dashoffset: 0; } }
@keyframes hello-glow { 0% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes hello-burst {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(-34px) scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(1); }
}
@keyframes hello-up { to { opacity: 1; transform: none; } }
@keyframes hello-fill { to { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .hello-root .hello-burst, .hello-root .hello-glow { display: none; }
  .hello-root.is-open .hello-ring-fill { animation: none; stroke-dashoffset: 0; }
  .hello-root.is-open .hello-avatar, .hello-root.is-open .hello-check { animation: none; transform: none; opacity: 1; }
  .hello-root.is-open .hello-check svg { animation: none; stroke-dashoffset: 0; }
  .hello-root.is-open .hello-eyebrow, .hello-root.is-open .hello-title, .hello-root.is-open .hello-sub,
  .hello-root.is-open .hello-role, .hello-root.is-open .hello-btn { animation: none; opacity: 1; transform: none; }
}

/* Dark mode: the card turns dark (--bg-card) but the icon colours above are dark shades. */
html.theme-dark .public-alert--success .public-alert-icon { color: #78ca97; }
html.theme-dark .public-alert--invalid .public-alert-icon { color: #fbbf24; }
html.theme-dark .public-alert--error .public-alert-icon { color: #fca5a5; }
html.theme-dark .public-alert--warning .public-alert-icon { color: #93c5fd; }
