/* AY Academy — portal chooser and teacher/student dashboard shells */

:root {
  --green: #25764f;
  --green-dark: #18593b;
  --deep: #143f32;
  --lime: #eaf5e7;
  --gold: #dcae54;
  --bg: #f5f8f4;
  --muted: #718176;
  --border: #e2eae3;
  --shadow: 0 12px 35px #15392712;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eef4ec;
  color: #1d342b;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid #6db98b;
  outline-offset: 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--deep);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ---------- Portal chooser ---------- */

.portal-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.portal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.portal-head .back { color: var(--green-dark); font-weight: 600; font-size: 14px; }

.portal-intro { max-width: 620px; }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--green);
}

.portal-intro h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -1.2px;
  color: var(--deep);
}

.portal-intro p { margin: 0; color: var(--muted); font-size: 16px; }

.portal-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 36px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-3px);
  border-color: #c9dfcd;
}

.portal-card .icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--lime);
  font-size: 20px;
}

.portal-card h2 { margin: 6px 0 0; font-size: 21px; color: var(--deep); }
.portal-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.portal-card .go { margin-top: 14px; color: var(--green-dark); font-weight: 700; font-size: 14px; }

.portal-foot {
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid #dbe7dd;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Dashboard placeholder ---------- */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px clamp(20px, 5vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.dash-header .who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-header .who-meta { display: flex; flex-direction: column; line-height: 1.25; }
.dash-header .who-meta strong { font-size: 14px; color: var(--deep); }
.dash-header .who-meta small { color: var(--muted); font-size: 12px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 13px;
}

.dash-main {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) 24px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 44px);
}

.dash-card h1 {
  margin: 14px 0 8px;
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: -0.9px;
  color: var(--deep);
}

.dash-card p { margin: 0 0 8px; color: var(--muted); }

.dash-note {
  margin-top: 26px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--green-dark);
  font-size: 13.5px;
}

/* ---------- Forced password change form ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  color: #3d5545;
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #dce7de;
  border-radius: 10px;
  background: #fff;
  color: #1d342b;
  font: inherit;
  font-weight: 400;
}

.field input:focus {
  border-color: #7fb695;
  outline: none;
  box-shadow: 0 0 0 3px #dff0e3;
}

.alert {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
}

.alert-error {
  border: 1px solid #efd3d3;
  background: #fff4f4;
  color: #a63d3d;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.btn:hover { background: var(--green-dark); }

.btn.outline {
  background: #fff;
  color: var(--deep);
  border: 1px solid var(--border);
}

.btn.outline:hover { background: var(--bg); }

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid #cfe3d3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner-lg { width: 38px; height: 38px; border-width: 4px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

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

.loading-block p { margin: 0; color: var(--muted); }

@media (max-width: 820px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-head { margin-bottom: 36px; }
}

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