@font-face {
  font-family: 'Roboto';
  src: url('assets/Roboto-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('assets/Roboto-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  font-family: 'Roboto', sans-serif;
  color: #18213f;
  background: #f8f7fc;
  --purple: #6935cf;
  --purple-dark: #5325b3;
  --purple-light: #f3ecff;
  --purple-border: #ded5f5;
  --line: #e6e4f0;
  --muted: #69738d;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, #f7f3ff 0%, #ede7fa 100%);
  font-family: 'Roboto', sans-serif;
  padding: 16px;
}

button, input, a {
  font: inherit;
}

h1, h2, h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-wrapper {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.portal-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 36px 28px 28px;
  box-shadow: 0 16px 40px #22194d12, 0 2px 6px #22194d06;
  border: 1px solid var(--purple-border);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Header */
.portal-header {
  text-align: center;
}

.wordmark {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #172038;
  display: inline-block;
}

.wordmark span {
  display: block;
  font-size: 13px;
  letter-spacing: .5px;
  font-weight: 700;
  color: var(--purple);
  margin-top: 2px;
}

.portal-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--purple);
  background: var(--purple-light);
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 20px;
  white-space: nowrap;
}

.portal-header h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin: 12px 0 6px;
  color: #172038;
}

.portal-header p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

/* 1. CTA Button: Bắt đầu học từ đầu tiên */
.cta-section {
  width: 100%;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 18px;
  box-shadow: 0 8px 20px #6935cf33, 0 3px 0 var(--purple-dark);
  transition: all .2s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px #6935cf44, 0 4px 0 var(--purple-dark);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px #6935cf33, 0 1px 0 var(--purple-dark);
}

.btn-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.btn-text {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.btn-text strong {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.btn-text small {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-arrow {
  font-size: 18px;
  font-weight: 800;
  opacity: 0.8;
  transition: transform .2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9aa2b8;
  font-size: 12px;
  font-weight: 500;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--line);
}

.divider span {
  padding: 0 12px;
  white-space: nowrap;
}

/* 2. Search Section */
.search-section {
  position: relative;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f7fd;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  transition: all .2s ease;
}

.search-box:focus-within {
  background: #ffffff;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px #6935cf15;
}

.search-icon {
  font-size: 16px;
  color: var(--muted);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: #18213f;
}

.search-box input::placeholder {
  color: #9aa2b8;
}

/* Dropdown Search Results */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--purple-border);
  border-radius: 16px;
  box-shadow: 0 14px 36px #1b16381a;
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-dropdown[hidden] {
  display: none;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  color: #1a223a;
  transition: background .15s ease;
  cursor: pointer;
}

.search-item:hover, .search-item.highlighted {
  background: var(--purple-light);
  color: var(--purple);
}

.search-item strong {
  font-size: 14px;
  font-weight: 700;
}

.search-item small {
  font-size: 11px;
  color: var(--muted);
}

.search-item-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Footer */
.portal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tiny-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b98188;
}
