* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #07111f;
  --bg-secondary: #0b1830;
  --panel: rgba(10, 22, 44, 0.92);
  --border: rgba(133, 171, 255, 0.16);
  --border-strong: rgba(133, 171, 255, 0.34);
  --text-main: #eef4ff;
  --text-soft: #aebddb;
  --text-dim: #7f94b8;
  --blue-2: #4d79ff;
  --royal: #7c63ff;
  --cyan-soft: #7fd8ff;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Cairo", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(124, 99, 255, 0.12), transparent 24%),
    radial-gradient(circle at top left, rgba(77, 121, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom, rgba(127, 216, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #07111f 0%, #081425 30%, #0b1830 65%, #091221 100%);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  border-bottom: 1px solid rgba(133, 171, 255, 0.08);
  background: rgba(6, 14, 28, 0.78);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1400px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 180px;
}

.brand h1 {
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(90deg, #dbe8ff, #7fd8ff 55%, #7c63ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand span {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  padding: 12px 18px;
  border-radius: 14px;
  color: var(--text-soft);
  font-weight: 800;
  font-size: 15px;
  transition: 0.25s ease;
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(21, 40, 75, 0.95), rgba(10, 22, 45, 0.95));
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--royal), var(--blue-2));
  box-shadow: 0 16px 35px rgba(77, 121, 255, 0.34);
  transition: 0.2s ease;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}

.discord-btn:hover {
  transform: translateY(-2px);
}

.page {
  width: min(1220px, calc(100% - 26px));
  margin: 34px auto 50px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(23, 45, 86, 0.94), rgba(8, 19, 39, 0.96));
  border: 1px solid rgba(133, 171, 255, 0.12);
  box-shadow: var(--shadow);
  padding: 36px;
  margin-bottom: 24px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-title {
  max-width: 740px;
}

.hero-title h2 {
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.15;
  margin-bottom: 12px;
  font-weight: 900;
}

.hero-title p {
  color: var(--text-soft);
  line-height: 2;
  font-size: 16px;
}

.hero-badge {
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(12, 27, 53, 0.72);
  border: 1px solid rgba(133, 171, 255, 0.14);
  color: #dce8ff;
  min-width: 220px;
  text-align: center;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.action-btn {
  padding: 14px 20px;
  border-radius: 15px;
  font-weight: 900;
  border: 1px solid var(--border);
  color: white;
  background: linear-gradient(180deg, rgba(21, 43, 83, 0.94), rgba(11, 22, 44, 0.96));
  transition: 0.2s ease;
  cursor: pointer;
}

.action-btn:hover { transform: translateY(-2px); }
.primary-btn {
  background: linear-gradient(135deg, var(--royal), var(--blue-2));
}

.section-panel {
  display: none;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(10, 21, 42, 0.98), rgba(9, 18, 36, 0.98));
  border: 1px solid rgba(133, 171, 255, 0.1);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-panel.active { display: block; }

.panel-head {
  padding: 28px 28px 18px;
  border-bottom: 1px solid rgba(133, 171, 255, 0.08);
  background: linear-gradient(180deg, rgba(18, 35, 68, 0.92), rgba(10, 20, 40, 0.94));
}

.panel-head h3 {
  font-size: 30px;
  margin-bottom: 8px;
  font-weight: 900;
}

.panel-head p {
  color: var(--text-soft);
  line-height: 1.9;
  font-size: 14px;
}

.panel-body { padding: 28px; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rule-card,
.profile-card,
.departments-card,
.apply-info,
.form-card,
.home-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 31, 61, 0.98), rgba(9, 20, 39, 0.98));
  border: 1px solid rgba(133, 171, 255, 0.12);
  padding: 22px;
}

.rule-card h4,
.profile-card h4,
.departments-card h4,
.apply-info h4,
.form-card h4,
.home-card h4 {
  font-size: 22px;
  margin-bottom: 16px;
  font-weight: 900;
}

.rule-card span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--cyan-soft);
  font-size: 13px;
  font-weight: 800;
}

.rule-card p,
.apply-info p,
.home-card p,
.login-placeholder p {
  color: var(--text-soft);
  line-height: 2;
  font-size: 14px;
}

.login-placeholder {
  text-align: center;
  padding: 18px 6px 8px;
}

.account-box {
  display: none;
  text-align: center;
}

.account-box.active { display: block; }

.avatar-wrap {
  width: 102px;
  height: 102px;
  margin: 0 auto 14px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--royal), var(--cyan-soft));
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  background: #091426;
}

.account-name {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
}

.account-tag {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: #d6e5ff;
  border: 1px solid rgba(133, 171, 255, 0.14);
  background: rgba(12, 24, 48, 0.8);
  font-size: 13px;
  font-weight: 800;
}

.apply-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
}

.departments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.department-item {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 37, 72, 0.96), rgba(10, 21, 42, 0.96));
  border: 1px solid rgba(133, 171, 255, 0.11);
  color: #e7f0ff;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.department-item.active,
.department-item:hover {
  border-color: rgba(127, 216, 255, 0.32);
  background: linear-gradient(135deg, rgba(124, 99, 255, 0.2), rgba(77, 121, 255, 0.2));
}

.selected-department {
  margin-top: 8px;
  color: var(--cyan-soft);
  font-weight: 900;
  font-size: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full { grid-column: 1 / -1; }

.field label {
  color: #dbe8ff;
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(133, 171, 255, 0.14);
  background: rgba(8, 18, 35, 0.92);
  color: white;
  border-radius: 14px;
  padding: 14px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.submit-btn {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-weight: 900;
  font-size: 15px;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--royal), var(--blue-2));
}

.notice {
  margin-top: 14px;
  border-radius: 16px;
  padding: 14px;
  color: #d9ebff;
  background: rgba(10, 25, 49, 0.86);
  border: 1px solid rgba(133, 171, 255, 0.12);
  font-size: 14px;
  line-height: 1.9;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 22px;
}

.info-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(8, 18, 35, 0.76);
  border: 1px solid rgba(133, 171, 255, 0.1);
}

.info-item span:first-child {
  color: #dbe8ff;
  font-weight: 800;
}

.info-item span:last-child {
  color: var(--cyan-soft);
  font-weight: 900;
}

@media (max-width: 1050px) {
  .home-grid,
  .apply-layout {
    grid-template-columns: 1fr;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    justify-content: center;
  }

  .brand {
    align-items: center;
  }

  .page {
    width: min(100%, calc(100% - 14px));
    margin-top: 16px;
  }

  .hero,
  .panel-body,
  .panel-head {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rules-grid,
  .departments-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .discord-btn {
    width: 100%;
  }
}