/* =========================================================
   Programs13
   Student Future Career Simulation System
   Shared Module Styles
   Version 3.1
   ========================================================= */

/* ---------------------------------------------------------
   1. Global reset and variables
   --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --p13-navy: #061223;
  --p13-navy-light: #12345a;
  --p13-blue: #2563eb;
  --p13-blue-light: #60a5fa;
  --p13-gold: #f3c400;

  --p13-text: #111827;
  --p13-muted: #64748b;
  --p13-line: #dbe4ef;
  --p13-surface: #f8fafc;
  --p13-white: #ffffff;

  --p13-danger: #9f1239;
  --p13-danger-bg: #fff1f2;
  --p13-danger-line: #fecdd3;

  --p13-shadow:
    0 14px 32px rgba(15, 23, 42, 0.10);

  --p13-shadow-large:
    0 24px 60px rgba(15, 23, 42, 0.22);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

  color: var(--p13-text);

  background:
    linear-gradient(
      180deg,
      #f5f9ff 0,
      #ffffff 360px
    );
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ---------------------------------------------------------
   2. Header and navigation
   --------------------------------------------------------- */

.p13-header {
  min-height: 96px;

  padding:
    18px
    clamp(24px, 4vw, 64px);

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 32px;

  color: var(--p13-white);

  background:
    linear-gradient(
      135deg,
      var(--p13-navy),
      var(--p13-navy-light)
    );

  box-shadow:
    0 8px 24px rgba(6, 18, 35, 0.18);
}

.p13-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 5px;

  color: var(--p13-white);
  flex: 0 0 auto;
}

.p13-brand span {
  color: #b8c8db;

  font-size: 11px;
  font-weight: 600;

  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.p13-brand strong {
  color: var(--p13-white);

  font-size: 22px;
  font-weight: 800;

  line-height: 1.2;
}

.p13-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 22px;

  flex-wrap: wrap;
}

.p13-nav a {
  position: relative;

  padding: 10px 0 8px;

  color: #dbe7f7;

  font-size: 15px;
  font-weight: 700;

  white-space: nowrap;

  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}

.p13-nav a:hover,
.p13-nav a:focus-visible,
.p13-nav a.active {
  color: var(--p13-white);
}

.p13-nav a.active {
  border-bottom:
    3px solid var(--p13-gold);
}

/* ---------------------------------------------------------
   3. Main shell
   --------------------------------------------------------- */

.p13-shell {
  width:
    min(
      1160px,
      calc(100% - 32px)
    );

  margin:
    36px auto 72px;
}

/* ---------------------------------------------------------
   4. Module hero
   --------------------------------------------------------- */

.module-hero {
  min-height: 390px;

  padding:
    clamp(30px, 5vw, 62px);

  display: grid;

  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(0, 0.85fr);

  align-items: center;

  gap: 36px;

  overflow: hidden;

  border-radius: 28px;

  color: var(--p13-white);

  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(96, 165, 250, 0.28),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      #07172b 0%,
      #12345a 62%,
      #174f86 100%
    );

  box-shadow:
    var(--p13-shadow-large);
}

.module-kicker {
  min-height: 30px;

  padding: 0 12px;

  display: inline-flex;
  align-items: center;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.11);

  color: #dbeafe;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-hero h1 {
  margin:
    18px 0 14px;

  color: var(--p13-white);

  font-size:
    clamp(40px, 5vw, 68px);

  font-weight: 800;

  line-height: 1.08;

  letter-spacing: -0.035em;
}

.module-hero p {
  max-width: 720px;

  margin: 0;

  color: #dbe7f7;

  font-size: 16px;
  line-height: 1.85;
}

.module-visual {
  position: relative;

  min-height: 260px;

  display: grid;
  place-items: center;
}

.module-number {
  width: 150px;
  height: 150px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: var(--p13-gold);
  color: var(--p13-text);

  font-size: 58px;
  font-weight: 900;

  box-shadow:
    0 0 0 24px rgba(243, 196, 0, 0.10),
    0 18px 38px rgba(0, 0, 0, 0.24);
}

/* ---------------------------------------------------------
   5. Buttons and actions
   --------------------------------------------------------- */

.module-actions,
.form-actions {
  margin-top: 28px;

  display: flex;
  align-items: center;

  gap: 14px;

  flex-wrap: wrap;
}

.form-actions {
  padding-top: 24px;

  border-top:
    1px solid var(--p13-line);
}

.btn {
  min-height: 48px;

  padding: 0 22px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid transparent;

  border-radius: 11px;

  font-size: 14px;
  font-weight: 800;

  line-height: 1;

  cursor: pointer;

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline:
    3px solid rgba(37, 99, 235, 0.24);

  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.65;

  cursor: not-allowed;

  transform: none;
}

.btn-primary {
  border-color: #e5b900;

  background: var(--p13-gold);
  color: var(--p13-text);

  box-shadow:
    0 8px 18px rgba(243, 196, 0, 0.22);
}

.btn-primary:hover {
  background: #ffd51a;
}

.btn-secondary {
  border-color: #cbd5e1;

  background: var(--p13-white);
  color: #102743;
}

.btn-secondary:hover {
  border-color: #94a3b8;

  background: #f8fafc;
}

/* ---------------------------------------------------------
   6. Module flow
   --------------------------------------------------------- */

.module-flow {
  margin-top: 34px;

  display: grid;

  grid-template-columns:
    repeat(6, minmax(0, 1fr));

  gap: 10px;
}

.flow-item {
  padding: 14px 10px;

  border:
    1px solid var(--p13-line);

  border-radius: 12px;

  background: var(--p13-white);
  color: var(--p13-muted);

  text-align: center;

  font-size: 12px;
  font-weight: 700;
}

.flow-item.active {
  border-color: #102743;

  background: #102743;
  color: var(--p13-white);
}

/* ---------------------------------------------------------
   7. Content card
   --------------------------------------------------------- */

.content-card {
  margin-top: 28px;

  padding:
    clamp(28px, 4vw, 44px);

  overflow: hidden;

  border:
    1px solid var(--p13-line);

  border-radius: 22px;

  background: var(--p13-white);

  box-shadow:
    var(--p13-shadow);
}

.content-card > .module-kicker {
  background: #eaf2ff;
  color: var(--p13-blue);
}

.content-card h1 {
  margin:
    16px 0 14px;

  color: #0f172a;

  font-size:
    clamp(30px, 3vw, 40px);

  font-weight: 800;

  line-height: 1.18;

  letter-spacing: -0.025em;
}

.content-card h2 {
  margin-top: 0;

  color: #0f172a;
}

.content-card > p {
  margin:
    0 0 4px;

  color: #334155;

  font-size: 16px;
  line-height: 1.7;
}

/* ---------------------------------------------------------
   8. Questions
   --------------------------------------------------------- */

.question-list {
  margin-top: 22px;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.question-item {
  padding: 18px;

  border:
    1px solid var(--p13-line);

  border-radius: 14px;

  background: var(--p13-surface);
}

.question-item strong {
  display: block;

  margin-bottom: 7px;

  color: var(--p13-blue);
}

/* ---------------------------------------------------------
   9. Forms
   --------------------------------------------------------- */

.form-grid {
  margin-top: 24px;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 20px 18px;
}

.form-group {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 9px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  color: #0f172a;

  font-size: 13px;
  font-weight: 800;

  line-height: 1.45;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;

  border:
    1px solid #cbd5e1;

  border-radius: 11px;

  background: var(--p13-white);
  color: var(--p13-text);

  font-size: 15px;

  outline: none;

  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
select {
  min-height: 50px;

  padding: 0 14px;
}

textarea {
  min-height: 120px;

  padding: 13px 14px;

  resize: vertical;

  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--p13-blue);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.12);
}

select {
  cursor: pointer;
}

/* ---------------------------------------------------------
   10. Checkbox and radio groups
   --------------------------------------------------------- */

.checkbox-grid,
.radio-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px 16px;
}

.checkbox-option,
.radio-option {
  min-height: 58px;

  padding: 14px 18px;

  display: flex;
  align-items: center;

  gap: 13px;

  border:
    1px solid var(--p13-line);

  border-radius: 13px;

  background: var(--p13-surface);

  cursor: pointer;

  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.checkbox-option:hover,
.radio-option:hover {
  border-color: #93c5fd;

  background: #f3f8ff;
}

.checkbox-option:focus-within,
.radio-option:focus-within {
  border-color: var(--p13-blue);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.10);
}

.checkbox-option input,
.radio-option input {
  width: 17px;
  height: 17px;

  flex: 0 0 auto;

  accent-color: var(--p13-blue);
}

.checkbox-option span,
.radio-option span {
  color: #0f172a;

  font-size: 14px;
  font-weight: 700;

  line-height: 1.4;
}

/* Compatibility with renderer markup */

.form-group label > input[type="checkbox"],
.form-group label > input[type="radio"] {
  margin-right: 10px;

  accent-color: var(--p13-blue);
}

/* ---------------------------------------------------------
   11. Validation messages
   --------------------------------------------------------- */

.p13-error,
.form-error {
  margin-top: 6px;

  color: var(--p13-danger);

  font-size: 12px;
  font-weight: 700;
}

.p13-alert-error {
  margin-top: 20px;

  padding: 16px 18px;

  border:
    1px solid var(--p13-danger-line);

  border-radius: 12px;

  background: var(--p13-danger-bg);
  color: var(--p13-danger);
}

.p13-alert-error ul {
  margin:
    10px 0 0;

  padding-left: 20px;
}

/* ---------------------------------------------------------
   12. Summary
   --------------------------------------------------------- */

.summary-grid {
  margin-top: 22px;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.summary-card {
  padding: 20px;

  border:
    1px solid var(--p13-line);

  border-radius: 16px;

  background: var(--p13-white);

  box-shadow:
    var(--p13-shadow);
}

.summary-card h2 {
  margin:
    0 0 14px;

  color: #1d4f7a;

  font-size: 18px;
}

.summary-card span {
  display: block;

  color: var(--p13-muted);

  font-size: 12px;

  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;

  margin-top: 8px;

  color: #0f172a;

  line-height: 1.55;
}

/* ---------------------------------------------------------
   13. Next module
   --------------------------------------------------------- */

.next-module {
  margin-top: 28px;

  padding: 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  border:
    1px solid #f4dc7c;

  border-radius: 18px;

  background: #fff8db;
}

.next-module h2 {
  margin:
    4px 0 6px;
}

.next-module p {
  margin: 0;

  color: #5f4a00;
}

/* ---------------------------------------------------------
   14. Flash messages
   --------------------------------------------------------- */

.p13-flash-wrap {
  width:
    min(
      1160px,
      calc(100% - 32px)
    );

  margin:
    20px auto 0;
}

.p13-flash {
  margin-bottom: 10px;

  padding: 14px 18px;

  border-radius: 12px;

  font-size: 14px;
  font-weight: 700;
}

.p13-flash-success {
  border:
    1px solid #bbf7d0;

  background: #f0fdf4;
  color: #166534;
}

.p13-flash-info {
  border:
    1px solid #bfdbfe;

  background: #eff6ff;
  color: #1d4ed8;
}

.p13-flash-warning {
  border:
    1px solid #fde68a;

  background: #fffbeb;
  color: #92400e;
}

.p13-flash-error {
  border:
    1px solid #fecaca;

  background: #fef2f2;
  color: #991b1b;
}

/* ---------------------------------------------------------
   15. Footer
   --------------------------------------------------------- */

.p13-footer {
  padding:
    30px 20px;

  text-align: center;

  background: var(--p13-navy);
  color: #9fb2c9;

  font-size: 12px;
  line-height: 1.65;
}

.p13-footer p {
  margin:
    3px 0;
}

/* ---------------------------------------------------------
   16. Responsive layout
   --------------------------------------------------------- */

@media (max-width: 1100px) {
  .p13-nav {
    gap: 15px;
  }

  .p13-nav a {
    font-size: 14px;
  }
}

@media (max-width: 980px) {
  .p13-header {
    min-height: 92px;

    padding:
      18px 32px;
  }

  .p13-brand strong {
    font-size: 21px;
  }

  .p13-nav {
    display: none;
  }

  .module-hero {
    grid-template-columns: 1fr;
  }

  .module-visual {
    display: none;
  }

  .module-flow {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .p13-shell {
    width:
      min(
        100% - 24px,
        1160px
      );

    margin:
      24px auto 48px;
  }

  .content-card {
    padding:
      26px 20px;
  }

  .form-grid,
  .question-list,
  .summary-grid,
  .checkbox-grid,
  .radio-grid {
    grid-template-columns: 1fr;
  }

  .module-flow {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .next-module {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .p13-header {
    min-height: 82px;

    padding:
      14px 16px;
  }

  .p13-brand span {
    font-size: 10px;
  }

  .p13-brand strong {
    font-size: 18px;
  }

  .content-card h1 {
    font-size: 29px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .module-flow {
    grid-template-columns: 1fr 1fr;
  }
}