/* =============================================================================
   NSFOM Core — Frontend CSS
   Scoped to .nsfom-core-form — zero admin side-effects.
   Loaded via wp_enqueue_scripts (front-end only).
   ========================================================================== */

/* ── Form wrapper ───────────────────────────────────────────────────────────── */

.nsfom-core-form {
  max-width: 540px;
  margin-inline: auto;
  padding: 2.5rem 0;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.nsfom-core-form__header {
  margin-bottom: 2rem;
}

.nsfom-core-form__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.nsfom-core-form__subtitle {
  font-size: 0.925rem;
  color: #a8c4d8;
  margin: 0;
}

/* ── Form element ────────────────────────────────────────────────────────────── */

.nsfom-core-form__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Fields ─────────────────────────────────────────────────────────────────── */

.nsfom-core-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nsfom-core-form__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2f0f9;
  letter-spacing: 0.04em;
}

.nsfom-core-form__required {
  color: #ff4d6d;
  margin-left: 0.2rem;
}

.nsfom-core-form__input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.925rem;
  color: #e2f0f9;
  background: rgba(8, 18, 34, 0.85);
  border: 1px solid rgba(32, 231, 255, 0.22);
  border-radius: 4px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.nsfom-core-form__input:focus {
  border-color: #20e7ff;
  box-shadow: 0 0 0 3px rgba(32, 231, 255, 0.15);
}

.nsfom-core-form__input::placeholder {
  color: #5d7488;
}

/* Select */
.nsfom-core-form__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2320e7ff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.nsfom-core-form__select option {
  background: #07111f;
  color: #e2f0f9;
}

/* Hint text */
.nsfom-core-form__hint {
  font-size: 0.78rem;
  color: #5d7488;
  margin: 0;
  line-height: 1.5;
}

/* ── Checkbox field ─────────────────────────────────────────────────────────── */

.nsfom-core-form__field--checkbox {
  flex-direction: row;
  align-items: flex-start;
}

.nsfom-core-form__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #a8c4d8;
  line-height: 1.55;
}

.nsfom-core-form__checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 16px;
  height: 16px;
  accent-color: #20e7ff;
  cursor: pointer;
}

.nsfom-core-form__checkbox-label a {
  color: #20e7ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Actions ────────────────────────────────────────────────────────────────── */

.nsfom-core-form__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.nsfom-core-form__forgot {
  font-size: 0.825rem;
  color: #5d7488;
  transition: color 150ms ease;
}

.nsfom-core-form__forgot:hover {
  color: #20e7ff;
}

/* ── Footer links ───────────────────────────────────────────────────────────── */

.nsfom-core-form__login-link,
.nsfom-core-form__register-link {
  font-size: 0.875rem;
  color: #5d7488;
  margin-top: 0.25rem;
}

.nsfom-core-form__login-link a,
.nsfom-core-form__register-link a {
  color: #20e7ff;
}

/* ── Error list ─────────────────────────────────────────────────────────────── */

.nsfom-core-form__errors {
  background: rgba(255, 77, 109, 0.10);
  border: 1px solid rgba(255, 77, 109, 0.45);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.5rem;
}

.nsfom-core-form__errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nsfom-core-form__errors li {
  font-size: 0.875rem;
  color: #ff8fa3;
  padding-left: 1.1rem;
  position: relative;
}

.nsfom-core-form__errors li::before {
  content: "✕";
  position: absolute;
  left: 0;
  font-size: 0.7rem;
  top: 0.12rem;
  color: #ff4d6d;
}

/* ── Notices ────────────────────────────────────────────────────────────────── */

.nsfom-core-form__notice {
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}

.nsfom-core-form__notice p {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: #e2f0f9;
}

.nsfom-core-form__notice p:last-child {
  margin-bottom: 0;
}

.nsfom-core-form__notice a {
  color: #20e7ff;
}

.nsfom-core-form__notice--success {
  background: rgba(56, 248, 161, 0.10);
  border: 1px solid rgba(56, 248, 161, 0.40);
}

.nsfom-core-form__notice--success p {
  color: #a0f5d5;
}

.nsfom-core-form__notice--info {
  background: rgba(32, 231, 255, 0.08);
  border: 1px solid rgba(32, 231, 255, 0.28);
}

.nsfom-core-form__notice--warning {
  background: rgba(245, 184, 75, 0.10);
  border: 1px solid rgba(245, 184, 75, 0.40);
}

.nsfom-core-form__notice--warning p {
  color: #f5d38a;
}

/* ── Account Dashboard ──────────────────────────────────────────────────────── */

.nsfom-dashboard {
  padding: 1.5rem 0 2.5rem;
}

.nsfom-dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--c-bg-elevated, #0b1628);
  border: 1px solid var(--c-border, rgba(32, 231, 255, 0.16));
  border-left: 3px solid var(--c-cyan, #20e7ff);
  border-radius: var(--radius-lg, 8px);
}

.nsfom-dashboard__header-label {
  font-family: var(--font-hud, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--c-cyan, #20e7ff);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.nsfom-dashboard__welcome {
  font-family: var(--font-hud, monospace);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin: 0;
}

/* Grid */
.nsfom-dashboard__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Cards */
.nsfom-dashboard-card {
  background: var(--c-bg-elevated, #0b1628);
  border: 1px solid var(--c-border, rgba(32, 231, 255, 0.16));
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nsfom-dashboard-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--c-border, rgba(32, 231, 255, 0.16));
  background: rgba(8, 18, 34, 0.55);
}

.nsfom-dashboard-card__title {
  font-family: var(--font-hud, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--c-cyan, #20e7ff);
  text-transform: uppercase;
}

/* Role / status badges */
.nsfom-dashboard-card__badge {
  font-family: var(--font-hud, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.nsfom-dashboard-card__badge--member {
  color: var(--c-cyan, #20e7ff);
  background: rgba(32, 231, 255, 0.10);
  border: 1px solid rgba(32, 231, 255, 0.28);
}

.nsfom-dashboard-card__badge--officer {
  color: var(--c-amber, #f5b84b);
  background: rgba(245, 184, 75, 0.10);
  border: 1px solid rgba(245, 184, 75, 0.30);
}

.nsfom-dashboard-card__badge--admin {
  color: var(--c-red, #ff4d6d);
  background: rgba(255, 77, 109, 0.10);
  border: 1px solid rgba(255, 77, 109, 0.30);
}

.nsfom-dashboard-card__badge--ok {
  color: var(--c-green, #38f8a1);
  background: rgba(56, 248, 161, 0.10);
  border: 1px solid rgba(56, 248, 161, 0.28);
}

/* Card body */
.nsfom-dashboard-card__body {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

/* Data rows */
.nsfom-dashboard-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(8, 18, 34, 0.40);
  border-radius: 3px;
}

.nsfom-dashboard-row__label {
  font-family: var(--font-hud, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.10em;
  color: var(--c-muted, #5d7488);
  text-transform: uppercase;
  flex-shrink: 0;
}

.nsfom-dashboard-row__value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text, #e2f0f9);
  text-align: right;
  word-break: break-all;
}

.nsfom-dashboard-row__value--muted {
  color: var(--c-muted, #5d7488);
}

.nsfom-dashboard-row__value--email {
  font-size: 0.75rem;
}

/* Hangar stat */
.nsfom-dashboard__hangar-stat {
  text-align: center;
  padding: 1.5rem 1rem 0.75rem;
  flex: 1;
}

.nsfom-dashboard__ship-count {
  display: block;
  font-family: var(--font-hud, monospace);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-cyan, #20e7ff);
  text-shadow: 0 0 20px rgba(32, 231, 255, 0.40);
}

.nsfom-dashboard__ship-label {
  display: block;
  font-family: var(--font-hud, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted, #5d7488);
  margin-top: 0.4rem;
}

.nsfom-dashboard__hangar-cta {
  padding: 0.75rem 1.1rem 1.1rem;
}

/* Quick actions bar */
.nsfom-dashboard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--c-bg-elevated, #0b1628);
  border: 1px solid var(--c-border, rgba(32, 231, 255, 0.16));
  border-radius: var(--radius-lg, 8px);
}

.nsfom-dashboard__actions-label {
  width: 100%;
  font-family: var(--font-hud, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--c-muted, #5d7488);
  text-transform: uppercase;
  margin: 0 0 0.1rem;
}

/* Danger-style button (logout) */
.nsfom-btn--danger {
  color: var(--c-red, #ff4d6d) !important;
  border-color: rgba(255, 77, 109, 0.35) !important;
}

.nsfom-btn--danger:hover {
  background: rgba(255, 77, 109, 0.12) !important;
  border-color: var(--c-red, #ff4d6d) !important;
  color: var(--c-red, #ff4d6d) !important;
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.20) !important;
}

/* Full-width block button helper */
.nsfom-btn--block {
  width: 100%;
  justify-content: center;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .nsfom-core-form {
    padding: 1.5rem 0;
  }

  .nsfom-core-form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nsfom-core-form__actions .nsfom-btn {
    justify-content: center;
    width: 100%;
  }

  .nsfom-dashboard__grid {
    grid-template-columns: 1fr;
  }

  .nsfom-dashboard__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nsfom-dashboard__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nsfom-dashboard__actions .nsfom-btn {
    justify-content: center;
    width: 100%;
  }
}

@media (min-width: 601px) and (max-width: 860px) {
  .nsfom-dashboard__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .nsfom-core-form__input {
    transition: none;
  }
}
