/* Basic Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  background: #0e1320; /* koyu lacivert */
  color: #f2f5ff;
}

/* Accessibility */
.visually-hidden {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: #121933; border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.logo-circle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #1b2b6b; color: #fff; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(18, 25, 51, .45), inset 0 0 0 1px rgba(255,255,255,.06);
}
.brand h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.lang-select, select, input {
  background: #0e1320; color: #e9efff; border: 1px solid rgba(255,255,255,.15); border-radius: .6rem;
  padding: .55rem .7rem; min-height: 44px;
}
.btn {
  min-height: 44px;
  padding: .6rem 1rem; border-radius: .75rem; border: 1px solid transparent;
  font-weight: 600; cursor: pointer;
}
.btn.primary { background: #2b5cff; color: white; }
.btn.secondary { background: transparent; border-color: rgba(255,255,255,.22); color: #fff; }
.btn.link { background: transparent; color: #b3c7ff; border: none; padding-left: 0; }

/* Layout */
#viewport { padding: 1rem; max-width: 1100px; margin: 0 auto; }
.login-panel { display: grid; place-items: center; min-height: calc(100dvh - 140px); }
.card {
  width: min(680px, 100%); background: #151c39; border: 1px solid rgba(255,255,255,.08);
  border-radius: 1.2rem; padding: 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.card h2 { margin-top: 0; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .75rem 0 1rem; }
.choice {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem;
  border: 1px solid rgba(255,255,255,.12); border-radius: .8rem; cursor: pointer;
}
.choice input[type="radio"] { display: none; }
.choice .radio-ui {
  width: 18px; height: 18px; border: 2px solid #7f95ff; border-radius: 50%;
  display: inline-block; position: relative;
}
.choice input[type="radio"]:checked + .radio-ui::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #2b5cff;
}

.fields { display: grid; gap: .75rem; margin-top: .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.field { display: grid; gap: .35rem; }
.field-label { font-size: .9rem; opacity: .9; }

.actions { margin-top: 1rem; display: flex; gap: .5rem; justify-content: flex-end; }

/* Module view */
.module-view { display: grid; gap: .75rem; }
.module-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .25rem 0;
}
.module-stage {
  height: calc(100dvh - 190px);
  border-radius: 1rem; overflow: hidden;
  border: 1px solid rgba(255,255,255,.12); background: #0b1124;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
#moduleFrame {
  width: 100%; height: 100%; border: 0; display: block; background: #fff;
}

/* Footer */
.app-footer { padding: .75rem 1rem; text-align: center; opacity: .7; }

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .choice-row { grid-template-columns: 1fr; }
  .brand h1 { font-size: .95rem; }
}
