/* Shared directory container */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* Directory index — hero */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.hero p {
  font-size: 16px;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 24px 0 32px;
}
.stat { text-align: center; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #4361ee;
}
.stat-label {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Letter nav — index version */
.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.letter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1a1a2e;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.15s;
}
.letter-link:hover {
  background: #4361ee;
  color: #fff;
  border-color: #4361ee;
}
.letter-link.active {
  background: #4361ee;
  color: #fff;
  border-color: #4361ee;
}

/* Letter grid */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.letter-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.letter-card:hover {
  border-color: #4361ee;
  box-shadow: 0 2px 8px rgba(67,97,238,0.1);
}
.letter-card .big {
  font-size: 28px;
  font-weight: 800;
  color: #4361ee;
  width: 44px;
  text-align: center;
}
.letter-card .info {}
.letter-card .count {
  font-size: 16px;
  font-weight: 700;
}
.letter-card .label {
  font-size: 12px;
  color: #9ca3af;
}
@media (max-width: 600px) {
  .stats { gap: 24px; }
  .stat-value { font-size: 22px; }
  .letter-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Letter page — header */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.page-header p {
  font-size: 14px;
  color: #6b7280;
}

/* Company list */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}
.company-row {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.company-row:hover { border-color: #4361ee; }
.company-row .icon {
  width: 44px;
  height: 44px;
  background: #eef2ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #4361ee;
  flex-shrink: 0;
}
.company-row .details {
  flex: 1;
  min-width: 0;
}
.company-row .name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.company-row .meta {
  font-size: 13px;
  color: #9ca3af;
}
.company-row .badge {
  background: #ecfdf5;
  color: #059669;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.pagination a {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1a1a2e;
}
.pagination a:hover {
  border-color: #4361ee;
  color: #4361ee;
}
.pagination .current {
  background: #4361ee;
  color: #fff;
  border: 1px solid #4361ee;
}
.pagination .dots {
  color: #9ca3af;
  border: none;
  background: none;
}

/* Signup gate */
.signup-gate {
  text-align: center;
  background: #fff;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: 40px 24px;
  margin-top: 8px;
}
.gate-icon {
  color: #9ca3af;
  margin-bottom: 12px;
}
.signup-gate h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.signup-gate p {
  font-size: 14px;
  color: #6b7280;
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.5;
}
.gate-btn {
  display: inline-block;
  background: #4cc9f0;
  color: #1a1a2e;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.gate-btn:hover { background: #3ab8df; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  margin: 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: #1a1a2e; }
.modal h3 {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.modal .subtitle {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
}
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-google:hover { background: #f9fafb; }
.modal-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.modal-divider span {
  padding: 0 12px;
  font-size: 13px;
  color: #9ca3af;
}
.modal input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
}
.modal input[type="email"]:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.btn-magic {
  width: 100%;
  padding: 10px;
  background: #4361ee;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-magic:hover { background: #3451d1; }
.btn-magic:disabled { background: #93a3f8; cursor: not-allowed; }
.modal .hint {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 12px;
}
.modal .msg {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.modal .msg-ok {
  background: #ecfdf5;
  color: #059669;
  border-left: 3px solid #059669;
}
.modal .msg-err {
  background: #fef2f2;
  color: #dc2626;
  border-left: 3px solid #dc2626;
}
@media (max-width: 600px) {
  .company-row { flex-wrap: wrap; }
  .company-row .badge { margin-left: 60px; margin-top: -4px; }
}
