/* =========================================================================
   style.css — global reset, typography, and shared app chrome
   (header bars, buttons, toasts, modals). Page-specific layout lives in
   customize.css / preview.css. The rendered login page itself lives
   entirely in login-page.css and is driven by CSS custom properties.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --app-purple-50: #F7F5FE;
  --app-purple-100: #EDEAF9;
  --app-purple-300: #C9BDF5;
  --app-purple-500: #8C6FF7;
  --app-purple-600: #6C3CE0;
  --app-purple-700: #5227B3;
  --app-ink: #1F1B33;
  --app-ink-soft: #4A4560;
  --app-border: #E3DFF5;
  --app-bg: #FBFAFE;
  --app-white: #FFFFFF;
  --app-success: #2FA36B;
  --app-error: #E24C4B;
  --app-warning: #C97A17;

  --shadow-sm: 0 1px 3px rgba(35, 20, 90, 0.08);
  --shadow-md: 0 8px 24px rgba(35, 20, 90, 0.10);
  --shadow-lg: 0 20px 48px rgba(35, 20, 90, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Poppins", "Inter", sans-serif;
}

* , *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--app-ink);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: linear-gradient(rgba(108, 60, 224, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(108, 60, 224, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  z-index: -1;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--app-purple-600);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.landing-preview {
  height: calc(100vh - 64px);
  min-height: 560px;
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, var(--app-purple-50), var(--app-bg));
}

/* ------------------------------- App header ---------------------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: var(--app-white);
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(31, 27, 51, 0.04), 0 8px 24px rgba(31, 27, 51, 0.035);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--app-ink);
}

.app-brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--app-purple-500), var(--app-purple-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-brand:hover .app-brand__mark { transform: rotate(-5deg) scale(1.06); box-shadow: 0 7px 16px rgba(82, 39, 179, 0.24); }

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .app-header { padding: 10px 14px; height: auto; min-height: 64px; gap: 12px; }
  .app-header__actions { flex-wrap: wrap; justify-content: flex-end; }
  .app-brand__text { font-size: 14px; }
  .btn { padding: 9px 13px; font-size: 13px; }
}

/* ---------------------------------- Buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.24), transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.btn:hover::after { transform: translateX(120%); }

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--app-purple-600), var(--app-purple-700));
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: var(--shadow-md); }

.btn--ghost {
  background: transparent;
  color: var(--app-ink-soft);
  border-color: var(--app-border);
}
.btn--ghost:hover { background: var(--app-purple-50); color: var(--app-ink); }

.btn--outline {
  background: white;
  color: var(--app-purple-700);
  border-color: var(--app-purple-300);
}
.btn--outline:hover { background: var(--app-purple-50); }

.btn--sm { padding: 7px 14px; font-size: 13px; }

.btn--icon {
  padding: 9px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------------------------- Toasts -------------------------------- */

.toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 13px 14px;
  font-size: 13.5px;
  border-left: 4px solid var(--app-purple-600);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--visible { opacity: 1; transform: translateX(0); }
.toast--leaving { opacity: 0; transform: translateX(16px); }

.toast--success { border-left-color: var(--app-success); }
.toast--error { border-left-color: var(--app-error); }
.toast--warning { border-left-color: var(--app-warning); }

.toast__icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--app-purple-100);
  color: var(--app-purple-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.toast--success .toast__icon { background: #E4F6ED; color: var(--app-success); }
.toast--error .toast__icon { background: #FBEAEA; color: var(--app-error); }
.toast--warning .toast__icon { background: #FCF0DE; color: var(--app-warning); }

.toast__message { flex: 1; color: var(--app-ink-soft); }

.toast__close {
  background: none; border: none; color: #B7B2CC;
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.toast__close:hover { color: var(--app-ink-soft); }

/* ---------------------------------- Modal -------------------------------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 27, 51, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.18s ease;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay--visible { opacity: 1; }

body.modal-open { overflow: hidden; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
  overflow: hidden;
}
.modal-overlay--visible .modal { transform: translateY(0) scale(1); }

.modal__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 22px 0;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  padding-right: 12px;
  color: var(--app-ink);
}

.modal__close {
  background: none; border: none; font-size: 20px; color: #B7B2CC;
  line-height: 1;
}
.modal__close:hover { color: var(--app-ink-soft); }

.modal__body {
  padding: 12px 22px 4px;
  font-size: 14px;
  color: var(--app-ink-soft);
}
.modal__body p { margin: 0 0 8px; }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 22px;
}

/* ------------------------------- Scrollbar polish ------------------------ */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--app-purple-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--app-purple-500); }
