:root {
  --purple-900: #2f1b52;
  --purple-700: #5b2a9c;
  --purple-600: #6b34b0;
  --purple-500: #8a5cd6;
  --purple-100: #efe6fb;

  --teal-600: #1fa398;
  --teal-100: #dff6f3;

  --pink-600: #ec6bae;
  --pink-100: #fde8f3;

  --gold-500: #f7b733;
  --gold-600: #f0952a;
  --gold-100: #fff3da;

  --cream: #fffaf2;
  --cream-2: #fff3e2;
  --ink: #2c2242;
  --ink-soft: #5b5270;
  --white: #ffffff;
  --danger: #d64545;
  --danger-100: #fbe4e4;

  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 20px 45px -20px rgba(47, 27, 82, 0.28);
  --shadow-pop: 0 14px 30px -12px rgba(47, 27, 82, 0.35);

  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, strong.brand-word { font-family: var(--font-display); }

::selection { background: var(--purple-100); color: var(--purple-900); }

/* =========================================================
   Login
   ========================================================= */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: var(--cream);
}
.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.7;
  z-index: 0;
}
.login-screen::before {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -160px;
  background: radial-gradient(circle at 30% 30%, var(--purple-100), transparent 70%);
  animation: float-blob 14s ease-in-out infinite;
}
.login-screen::after {
  width: 460px;
  height: 460px;
  bottom: -200px;
  right: -160px;
  background: radial-gradient(circle at 60% 40%, var(--teal-100), transparent 70%);
  animation: float-blob 16s ease-in-out infinite reverse;
}
@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.06); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-soft);
  animation: card-in 0.6s var(--ease-bounce) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 18px;
  box-shadow: var(--shadow-pop);
  object-fit: cover;
  animation: logo-pop 0.7s 0.15s var(--ease-bounce) both;
}
@keyframes logo-pop {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.login-brand {
  font-family: var(--font-display);
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 2px;
  background: linear-gradient(90deg, var(--purple-700), var(--pink-600) 55%, var(--gold-600));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.login-sub {
  text-align: center;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--purple-900);
  margin-bottom: 6px;
  margin-top: 16px;
}
input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--purple-100);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 4px var(--purple-100);
}
textarea { resize: vertical; min-height: 76px; }
input[readonly], textarea[readonly] {
  background: var(--cream-2);
  color: var(--ink-soft);
  cursor: not-allowed;
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-smooth), opacity 0.18s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: white;
  box-shadow: var(--shadow-pop);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(47, 27, 82, 0.45); }
.btn-danger { background: var(--danger-100); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--purple-100); color: var(--ink); }
.btn-outline:hover { border-color: var(--purple-500); color: var(--purple-700); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; margin-top: 22px; }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none !important; }

.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 12px; font-weight: 600; }
.success-msg { color: var(--teal-600); font-size: 0.85rem; font-weight: 600; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
.btn-outline .spinner { border-color: var(--purple-100); border-top-color: var(--purple-600); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Shell / topbar / tabs
   ========================================================= */
#app { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--purple-100);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-pop);
  flex-shrink: 0;
}
.topbar-brand-text { min-width: 0; }
.topbar-brand-text h1 {
  font-size: 1.02rem;
  margin: 0;
  color: var(--purple-900);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand-text span {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-user {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--purple-700);
  background: var(--purple-100);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 28px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all 0.2s var(--ease-smooth);
}
.tab-btn:hover { background: var(--purple-100); color: var(--purple-700); }
.tab-btn.is-active {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: white;
  box-shadow: var(--shadow-pop);
}

.content {
  padding: 24px 28px 70px;
  max-width: 1440px;
  animation: content-in 0.4s var(--ease-smooth) both;
}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(90deg, var(--purple-100), var(--teal-100));
  border: 1px solid var(--purple-500);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  animation: content-in 0.4s var(--ease-smooth) both;
}
.info-banner-icon { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-banner p { margin: 0; font-size: 0.86rem; color: var(--purple-900); line-height: 1.5; }
.info-banner strong { color: var(--purple-700); }

.field-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .field-row-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .field-row-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1440px) {
  .field-row-grid { grid-template-columns: repeat(4, 1fr); }
}
@keyframes content-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Textos
   ========================================================= */
.field-group {
  background: var(--white);
  border: 1px solid var(--purple-100);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.25s var(--ease-smooth);
  height: 100%;
}
.field-group h2 {
  font-size: 1.02rem;
  margin: 0 0 16px;
  color: var(--purple-700);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-group h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-600), var(--gold-500));
  flex-shrink: 0;
}
.field-row {
  background: var(--cream);
  border: 1px solid var(--purple-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  height: 100%;
}
.field-row .field-label { font-weight: 700; margin-bottom: 8px; color: var(--ink); font-size: 0.92rem; }
.lang-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.lang-pair .lang-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal-600);
  font-weight: 800;
  margin-bottom: 4px;
  display: block;
}
.field-actions { margin-top: 10px; display: flex; align-items: center; gap: 10px; }

@media (max-width: 640px) {
  .lang-pair { grid-template-columns: 1fr; }
}

/* =========================================================
   Galeria
   ========================================================= */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.category-tabs button { border-radius: 999px; }
.category-tabs button.is-active {
  background: linear-gradient(135deg, var(--teal-600), #17827a);
  color: white;
  border-color: transparent;
}

.upload-box {
  background: linear-gradient(180deg, var(--purple-100), var(--white) 60%);
  border: 2px dashed var(--purple-500);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 22px;
  transition: border-color 0.2s, background 0.2s;
}
.upload-box.is-dragover { border-color: var(--pink-600); background: var(--pink-100); }
.upload-box label { color: var(--purple-900); }

.count-badge {
  display: inline-block;
  background: var(--gold-100);
  color: #8a5a12;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  margin-left: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.photo-card {
  background: var(--white);
  border: 1px solid var(--purple-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s var(--ease-smooth);
  animation: card-in 0.4s var(--ease-smooth) both;
}
.photo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.photo-card .photo-img-wrap { position: relative; overflow: hidden; }
.photo-card img { width: 100%; height: 150px; object-fit: cover; display: block; transition: transform 0.4s var(--ease-smooth); }
.photo-card:hover img { transform: scale(1.06); }
.photo-card .photo-body { padding: 12px; }
.photo-card input[type="text"] { font-size: 0.8rem; padding: 8px 10px; margin-bottom: 10px; }
.photo-card .photo-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* =========================================================
   Cuenta
   ========================================================= */
.settings-card { max-width: 420px; }

/* =========================================================
   Toasts
   ========================================================= */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(340px, calc(100vw - 40px));
}
.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  box-shadow: var(--shadow-pop);
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--teal-600);
  animation: toast-in 0.35s var(--ease-bounce) both;
}
.toast.is-error { border-left-color: var(--danger); color: var(--danger); }
.toast.is-leaving { animation: toast-out 0.3s var(--ease-smooth) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* =========================================================
   Confirm modal
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 34, 66, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
  animation: fade-in 0.2s var(--ease-smooth);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 26px 26px 20px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-soft);
  animation: card-in 0.3s var(--ease-bounce) both;
}
.modal-card h3 { margin: 0 0 10px; color: var(--purple-900); font-size: 1.05rem; }
.modal-card p { margin: 0 0 20px; color: var(--ink-soft); font-size: 0.9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .topbar-brand-text h1 { font-size: 0.9rem; }
  .topbar-user { display: none; }
  .tabs { padding: 12px 16px 0; }
  .content { padding: 18px 16px 60px; }
  .field-group { padding: 18px 16px; }
  .login-card { padding: 34px 26px 28px; }
}
