/*!
 * SININBE EDU — validation and session-notice styling.
 *
 * Everything here is driven by the platform's own CSS custom properties, so it
 * follows the active theme automatically: no hard-coded light or dark colours
 * that could leave a light island inside the dark interface or the reverse.
 * Direction is handled with logical properties (inline-start / inline-end), so
 * Arabic RTL and Latin LTR both lay out correctly without a separate rule set.
 */

/* ─────────────────────────────── inline field validation ─────────────── */

.se-ux-error {
  display: none;
  margin-block-start: 6px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--danger, #ff6b6b);
  text-align: start;
}

.se-ux-error.on {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: se-ux-error-in .18s ease-out both;
}

.se-ux-error.on::before {
  content: "!";
  flex: 0 0 auto;
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 900;
  color: #fff;
  background: var(--danger, #ff6b6b);
}

@keyframes se-ux-error-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

input.se-ux-invalid,
select.se-ux-invalid,
textarea.se-ux-invalid,
.se-ux-invalid > input,
.se-phone-composite.se-ux-invalid {
  border-color: var(--danger, #ff6b6b) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger, #ff6b6b) 22%, transparent);
}

.se-ux-invalid-holder > span:first-child,
.se-ux-invalid-holder > .se-field-label {
  color: var(--danger, #ff6b6b);
}

/* The country pickers are buttons, not inputs. */
button.se-ux-invalid,
.se-ux-invalid.se-phone-country-trigger,
.se-ux-invalid.se-country-trigger {
  border-color: var(--danger, #ff6b6b) !important;
}

@media (prefers-reduced-motion: reduce) {
  .se-ux-error.on { animation: none; }
}

/* ───────────────────────────────────── busy save buttons ─────────────── */

.btn.se-ux-busy,
button.se-ux-busy {
  position: relative;
  cursor: progress;
  opacity: .78;
}

.btn.se-ux-busy::after,
button.se-ux-busy::after {
  content: "";
  position: absolute;
  inset-inline-end: 10px;
  inset-block-start: 50%;
  inline-size: 13px;
  block-size: 13px;
  margin-block-start: -7px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-start-color: transparent;
  animation: se-ux-spin .7s linear infinite;
}

@keyframes se-ux-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .btn.se-ux-busy::after, button.se-ux-busy::after { animation-duration: 2.4s; }
}

/* ─────────────────────────────────── session expiry notice ───────────── */

.se-idle-notice {
  position: fixed;
  inset-block-start: max(12px, env(safe-area-inset-top));
  inset-inline: 0;
  margin-inline: auto;
  z-index: 2147483003;
  inline-size: fit-content;
  max-inline-size: calc(100vw - 24px);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary, #eef2ff);
  background: var(--surface-2, var(--card, #14182a));
  border: 1px solid var(--border, rgba(255, 255, 255, .16));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .42);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.se-idle-notice.on { opacity: 1; transform: none; }
