/* css/portal.css — EduTest Pro Portal
   Extends css/style.css. Uses the same CSS vars: --primary, --text, --bg etc.
*/

.pt-hidden { display: none !important; }

/* ─── Loading screen ────────────────────────────────────────── */
#portal-loader {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #00b894, #00a376);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999; transition: opacity 0.4s ease;
}
.pl-logo    { font-size: 5rem; font-weight: 900; color: #fff; letter-spacing: -3px; margin-bottom: 0.75rem; }
.pl-title   { color: rgba(255,255,255,0.9); font-size: 1.2rem; font-weight: 600; margin-bottom: 1.5rem; }
.pl-status  { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-top: 1rem; min-height: 1.4em; text-align: center; }
.pl-spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: pt-spin 0.8s linear infinite; }
@keyframes pt-spin { to { transform: rotate(360deg); } }

/* ─── Nav ───────────────────────────────────────────────────── */
.pt-nav { background: linear-gradient(135deg, #00b894, #00a376); padding: 0.65rem 0; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.pt-nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pt-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.pt-brand-logo { font-size: 1.3rem; font-weight: 900; color: #fff; background: rgba(255,255,255,0.2); border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.pt-brand-name { font-size: 1rem; font-weight: 700; color: #fff; }
.pt-nav-links  { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pt-nav-link   { color: rgba(255,255,255,0.9); text-decoration: none; padding: 0.35rem 0.8rem; border-radius: 20px; font-size: 0.82rem; font-weight: 600; border: 1px solid rgba(255,255,255,0.35); transition: background 0.2s; white-space: nowrap; }
.pt-nav-link:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ─── Login ─────────────────────────────────────────────────── */
#portal-login { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.pt-login-layout { display: flex; align-items: center; justify-content: center; flex: 1; gap: 1rem; padding: 2rem 1rem; flex-wrap: wrap; }
.pt-ad-side { flex: 0 0 160px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .pt-ad-side { display: none; } }

.pt-login-card { flex: 0 0 auto; width: 100%; max-width: 460px; text-align: center; padding: 2.75rem 2.25rem; }
.pt-login-logo { font-size: 4rem; font-weight: 900; color: var(--primary); letter-spacing: -2px; margin-bottom: 0.5rem; }
.pt-login-title { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 0.4rem; }
.pt-login-subtitle { color: var(--text-light); font-size: 0.95rem; margin-bottom: 1.5rem; }

.pt-app-badges { display: flex; gap: 8px; justify-content: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pt-badge      { padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 700; }
.pt-badge-cbt  { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.pt-badge-rds  { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.pt-badge-sms  { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }

.pt-error-banner { background: #ffeaea; border: 1px solid #e74c3c; border-radius: 8px; padding: 0.85rem 1.1rem; margin-bottom: 1.25rem; color: #c0392b; font-size: 0.9rem; text-align: left; line-height: 1.5; }
.pt-login-note    { margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }
.pt-login-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.pt-install-link  { display: inline-block; color: var(--primary); font-weight: 600; font-size: 0.9rem; text-decoration: none; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--primary); transition: all 0.2s; }
.pt-install-link:hover { background: var(--primary); color: #fff; }

/* ─── Bottom nav + footer ───────────────────────────────────── */
.pt-bottom-nav { background: #2d3436; padding: 0.7rem 1.5rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.pt-bottom-nav a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 15px; border: 1px solid rgba(255,255,255,0.15); transition: background 0.2s, color 0.2s; white-space: nowrap; }
.pt-bottom-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.pt-footer       { background: linear-gradient(135deg, #00b894, #00a376); padding: 0.75rem 0; text-align: center; }
.pt-footer-inner { display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: rgba(255,255,255,0.85); font-size: 0.82rem; flex-wrap: wrap; flex-direction: column; row-gap: 4px; }
.pt-footer-logo  { font-size: 1rem; font-weight: 900; color: #fff; }
.pt-footer-link  { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.25); transition: background 0.2s; }
.pt-footer-link:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ─── Dashboard header ──────────────────────────────────────── */
.pd-header        { background: linear-gradient(135deg, #00b894, #00a376); color: #fff; padding: 0.9rem 0; box-shadow: 0 2px 12px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 100; }
.pd-header-inner  { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pd-header-brand  { display: flex; align-items: center; gap: 12px; }
.pd-logo-text     { font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: -1px; }
.pd-school-name   { font-size: 1rem; font-weight: 600; color: #fff; opacity: 0.95; }
.pd-header-right  { display: flex; align-items: center; gap: 10px; }
.pd-avatar        { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.25); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; overflow: hidden; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.4); }
.pd-avatar img    { width: 100%; height: 100%; object-fit: cover; }
.pd-user-name     { font-weight: 600; font-size: 0.9rem; color: #fff; }
.pd-user-role     { font-size: 0.75rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.5px; }
.pd-logout-btn    { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.4); color: #fff; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: background 0.2s; white-space: nowrap; }
.pd-logout-btn:hover { background: rgba(255,255,255,0.28); }

/* ─── Dashboard main ────────────────────────────────────────── */
.pd-main          { flex: 1; padding: 2rem 0; background: var(--bg); min-height: calc(100vh - 130px); }
.pd-welcome       { margin-bottom: 1.75rem; }
.pd-greeting      { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 0.3rem; }
.pd-welcome-sub   { color: var(--text-light); font-size: 0.95rem; }
.pd-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); margin-bottom: 0.875rem; }

.pd-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.pd-app-card { background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border: 1px solid var(--border); padding: 1.5rem 1.4rem; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; }
.pd-app-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.11); }
.pd-app-icon   { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.pd-app-name   { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.pd-app-desc   { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; flex: 1; }
.pd-app-action { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 700; padding: 0.45rem 1rem; border-radius: 8px; width: fit-content; }
.pd-app-badge  { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; width: fit-content; }

#pd-sub-banner .sub-warn { border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.25rem; font-size: 0.9rem; line-height: 1.5; }
#pd-sub-banner .sub-warn.warn-yellow { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
#pd-sub-banner .sub-warn.warn-red    { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.pd-quick-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.pd-quick-link { display: inline-flex; align-items: center; gap: 6px; padding: 0.5rem 1rem; border-radius: 8px; background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.88rem; font-weight: 600; transition: all 0.15s; white-space: nowrap; }
.pd-quick-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ─── Install page ──────────────────────────────────────────── */
.pt-install-tabs { display: flex; gap: 6px; margin-bottom: 1rem; flex-wrap: wrap; }
.pt-tab { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text-light); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.pt-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.pt-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.pt-steps li { display: flex; align-items: flex-start; gap: 12px; }
.pt-step-num { min-width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; margin-top: 2px; }
.pt-steps li div { font-size: 0.9rem; color: var(--text); line-height: 1.65; }
.pt-steps li div code { font-size: 0.82rem; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-family: monospace; }
.pt-note { margin-top: 1.25rem; padding: 0.8rem 1rem; border-radius: 8px; background: var(--primary-light); border: 1px solid #b2dfdb; font-size: 0.85rem; color: var(--primary-dark); line-height: 1.6; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pd-header-right .pd-user-info { display: none; }
  .pd-app-grid { grid-template-columns: 1fr; }
  .pt-tab { font-size: 0.78rem; padding: 0.4rem 0.65rem; }
}
