@font-face {
  font-family: 'Fredoka';
  src: url('../assets/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #4b302a;
  --berry: #c94d6d;
  --berry-dark: #a83d58;
  --pink: #ffd6e0;
  --peach: #ffe3cf;
  --butter: #fff1b8;
  --mint: #cfeee0;
  --lavender: #e7dcfb;
  --cream: #fff8ee;
  --paper: #fffdf8;
  --muted: #7c6053;
  --border: rgba(75, 48, 42, 0.16);
  --font-display: 'Fredoka', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at 8% -10%, rgba(255, 192, 209, 0.5), transparent 34rem),
    radial-gradient(ellipse at 100% 0%, rgba(255, 235, 168, 0.4), transparent 32rem),
    radial-gradient(ellipse at 50% 110%, rgba(184, 226, 205, 0.45), transparent 42rem),
    var(--cream);
}

h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
}

a { color: inherit; }

.portal-topbar {
  width: min(1040px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(145deg, #f891ab, #e56083);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.18);
}

.portal-admin-link {
  padding: 8px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.portal-admin-link:hover { background: #fff; color: var(--ink); }

.portal-main {
  width: min(1040px, calc(100% - 32px));
  margin: 22px auto 40px;
  flex: 1;
}

.portal-card,
.portal-hero,
.portal-section {
  border: 2.5px solid var(--ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 214, 224, 0.65) 0 5rem, transparent 5.1rem),
    linear-gradient(135deg, #fffaf1, #ffe9e4);
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.09);
}

.login-card {
  max-width: 520px;
  margin: 40px auto;
  padding: clamp(24px, 5vw, 40px);
}

.eyebrow {
  color: var(--berry);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-card h1 {
  margin: 6px 0 10px;
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.portal-lead {
  color: var(--muted);
  line-height: 1.6;
  max-width: 60ch;
}

.portal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

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

.field > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.field input:focus {
  border-color: var(--berry);
  box-shadow: 0 0 0 3px rgba(201, 77, 109, 0.14);
}

.portal-error {
  color: var(--berry-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.portal-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  border-color: #c24a68;
  background: linear-gradient(160deg, #f891ab, #e56083);
  color: #fff;
  box-shadow: 0 5px 0 #c24a68;
}

.btn-primary:hover { box-shadow: 0 7px 0 #c24a68; }

.btn-ghost {
  border-color: var(--border);
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.06);
}

.btn-lg { padding: 14px 22px; border-radius: 18px; font-size: 1rem; }
.btn-sm { padding: 7px 12px; font-size: 0.76rem; }

.btn:disabled { opacity: 0.55; cursor: default; pointer-events: none; }

.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
}

.portal-hero h1 { margin: 4px 0 8px; font-size: clamp(2.2rem, 5vw, 3.3rem); }

.portal-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-section { margin-top: 22px; padding: clamp(20px, 4vw, 30px); }

.portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.portal-section h2 { margin-top: 3px; font-size: clamp(1.6rem, 3vw, 2.1rem); }

.profile-grid,
.app-grid {
  display: grid;
  gap: 12px;
}

.profile-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.app-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.portal-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.06);
}

.portal-profile--parent { background: linear-gradient(150deg, #fffdf8, #f0e9fd); }

.portal-avatar {
  width: 54px;
  height: 54px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe9ef, #ffd3de);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.portal-profile-copy { flex: 1; min-width: 0; }
.portal-profile-copy h3 { font-size: 1.2rem; }
.portal-profile-copy p { margin-top: 2px; color: var(--muted); font-size: 0.75rem; }

.portal-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: #3f6f58;
  font-size: 0.6rem;
  font-weight: 900;
}

.portal-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--paper);
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.portal-app:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 77, 109, 0.45);
}

.portal-app-icon {
  width: 48px;
  height: 48px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--butter);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.portal-app-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.portal-app-copy strong { font-family: var(--font-display); font-size: 1.1rem; }
.portal-app-copy small { color: var(--muted); font-size: 0.74rem; line-height: 1.4; }
.portal-app-arrow { color: var(--berry); font-weight: 900; }

.portal-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 560px) {
  .portal-hero { align-items: flex-start; }
  .portal-hero-actions { width: 100%; }
  .portal-hero-actions .btn { flex: 1; }
  .generic-card { padding: 18px; }
}
