:root {
  --amber: #ffa500;
  --amber-border: rgba(255, 165, 0, .9);
  --amber-bg: rgba(255, 165, 0, .12);
  --bg: linear-gradient(160deg, #050612 0%, #0c0d1a 40%, #111322 100%);
  --card-bg: rgba(5, 6, 18, 0.92);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f5;
  --text-secondary: #aaa;
  --gold: #F5B843;
  --green: #22C55E;
  --red: #DC2626;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Arial, sans-serif; background: #000; color: var(--text-primary); }

.frame-page, .frame-page .frame-wrap, .frame-page iframe {
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.frame-wrap, iframe { border: 0; display: block; }
iframe { width: 100%; opacity: 0; transition: opacity .28s ease; background: #0a0a0a; }
body.ready iframe { opacity: 1; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity .28s ease, visibility .28s ease;
}
.loading.hide { opacity: 0; visibility: hidden; }
.loading-box { display: grid; place-items: center; gap: 14px; color: #aaa; font-size: 13px; }
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .12);
  border-top-color: var(--amber);
  animation: spin 1s linear infinite;
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: #050612;
}
.fallback[hidden] { display: none; }
.fallback img { width: 72px; height: 72px; object-fit: contain; }
.fallback h1 { margin: 0; font-size: 24px; }
.fallback p { margin: 0; color: #aaa; }
.fallback a { color: var(--amber); font-weight: 700; }
.no-script { color: #fff; }

.supervisor-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.card {
  width: 100%;
  max-width: 480px;
  padding: 48px 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeUp .5s ease-out;
}
.logo { height: 32px; margin-bottom: 28px; }
.icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  animation: pulse 2s ease-in-out infinite;
}
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.message, .form-info {
  margin: 0 auto;
  max-width: 360px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.form-area { margin-top: 16px; text-align: left; }
.form-info { text-align: center; margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  outline: none;
}
textarea:focus { border-color: rgba(220,38,38,.75); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.actions { margin-top: 16px; }
button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: opacity .2s ease, transform .2s ease;
}
button.active { background: linear-gradient(135deg, #DC2626, #991B1B); cursor: pointer; }
button.active:hover { transform: translateY(-1px); }
button.disabled { background: #555; cursor: not-allowed; }
.helper { margin-top: 10px; font-size: 12px; color: #777; text-align: right; }
.divider { height: 1px; background: rgba(255,255,255,.08); margin: 32px 0; }
.footer { margin: 0; font-size: 11px; color: #555; letter-spacing: .08em; text-transform: uppercase; }
.footer .brand { color: var(--gold); }
.svg-spinner { width: 48px; height: 48px; animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, .15); } 50% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { iframe, .loading, .card, .spinner, .svg-spinner { transition: none !important; animation: none !important; } }
