
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background-color: #f8f9fa;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: 0;
}

.container > p + p {
    margin-top: 1rem;
}

header {
    text-align: center;
    padding: 3rem 0 2rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.description {
    font-size: 1.05rem;
    color: #4a4a68;
    max-width: 560px;
    margin: 0 auto;
}

nav {
    margin-top: 2.5rem;
}

nav h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.nav-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.nav-list a {
    display: block;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-list a:hover,
.nav-list a:focus {
    border-color: #4a6cf7;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.12);
    outline: none;
}

.nav-list a:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.nav-link-title {
    font-weight: 600;
    font-size: 1rem;
}

.nav-link-desc {
    font-size: 0.875rem;
    color: #6b6b80;
    margin-top: 0.25rem;
}

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e8;
    text-align: center;
    font-size: 0.8rem;
    color: #8888a0;
}

.notification-banner {
    background: #fff3cd;
    border: 1px solid #c29d0b;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    color: #664d03;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-banner::before {
    content: "\26A0\FE0F";
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-banner p {
    margin: 0;
}

.ai-chat-example {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-chat-prompt,
.ai-chat-response {
    background: #2a2a2a;
    color: #e0e0e0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.ai-chat-prompt {
    margin-left: 3rem;
}

.ai-chat-response ol,
.ai-chat-response ul {
    padding-left: 1.25rem;
}

.ai-chat-response p,
.ai-chat-response li {
    margin-bottom: 0.5rem;
}

.ai-chat-action {
    border: 1px solid #fff;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    color: #e0e0e0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-chat-action::before {
    content: "\1F6E0\FE0F";
}

.ai-chat-action-status {
    color: #4ade80;
}

.ai-chat-action-status::after {
    content: " \2714";
}

.ai-chat-example .ai-chat-prompt,
.ai-chat-response > * {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ai-chat-reveal {
    opacity: 1 !important;
}

@media (max-width: 480px) {
    .container {
    padding: 1.5rem 1rem;
    }

    header {
    padding: 2rem 0 1.5rem;
    }

    h1 {
    font-size: 1.4rem;
    }
}


/* Breadcrumb Navigation */

.breadcrumb-nav {
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  margin-top: 0;
}

.breadcrumb-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb-nav li {
  display: inline;
  font-size: 0.9rem;
  color: #4a4a68;
}

.breadcrumb-nav li::before {
  content: "/";
  margin: 0 0.5rem;
  color: #8888a0;
}

.breadcrumb-nav li:first-child::before {
  content: none;
  margin: 0;
}

.breadcrumb-nav a {
  color: #4a6cf7;
  text-decoration: none;
}

.breadcrumb-nav a:hover,
.breadcrumb-nav a:focus {
  text-decoration: underline;
}

.breadcrumb-nav a:focus-visible {
  outline: 2px solid #4a6cf7;
  outline-offset: 2px;
}


/* Auth Forms */

.auth-form {
  background: #fff;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  padding: 2rem;
  margin-top: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #1a1a2e;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.profile-section input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: #1a1a2e;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.profile-section input:focus {
  outline: none;
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.auth-form .btn,
.profile-section .btn,
.btn {
  display: inline-block;
  padding: 0.7rem 1.75rem;
  background: linear-gradient(135deg, #4a6cf7 0%, #3a5ce5 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(74, 108, 247, 0.25);
  letter-spacing: 0.01em;
}

.auth-form .btn:hover,
.profile-section .btn:hover,
.btn:hover,
.auth-form .btn:focus,
.profile-section .btn:focus,
.btn:focus {
  background: linear-gradient(135deg, #3a5ce5 0%, #2e4fd4 100%);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.35);
  transform: translateY(-1px);
}

.auth-form .btn:focus-visible,
.profile-section .btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid #4a6cf7;
  outline-offset: 2px;
}

.auth-form .btn:active,
.profile-section .btn:active,
.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(74, 108, 247, 0.2);
}

.auth-form .btn:disabled,
.profile-section .btn:disabled,
.btn:disabled {
  background: #a0a0b8;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.auth-form .btn-secondary,
.profile-section .btn-secondary,
.btn-secondary {
  background: linear-gradient(135deg, #424286 0%, #24244e 100%);
  box-shadow: 0 2px 6px rgba(107, 107, 128, 0.25);
}

.auth-form .btn-secondary:hover,
.profile-section .btn-secondary:hover,
.btn-secondary:hover,
.auth-form .btn-secondary:focus,
.profile-section .btn-secondary:focus,
.btn-secondary:focus {
  background: linear-gradient(135deg, #555568 0%, #444458 100%);
  box-shadow: 0 4px 12px rgba(107, 107, 128, 0.35);
}

.auth-form .form-footer {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #6b6b80;
}

.auth-form .form-footer a {
  color: #4a6cf7;
  text-decoration: none;
}

.auth-form .form-footer a:hover {
  text-decoration: underline;
}

/* Alerts */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

.alert.visible {
  display: block;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* API Key Display */

.api-key-display {
  background: #1a1a2e;
  color: #4ade80;
  padding: 1rem;
  border-radius: 6px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  margin: 1rem 0;
  position: relative;
}

.api-key-display .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.api-key-display .copy-btn:hover {
  background: #444;
}

/* Profile Page */

.profile-section {
  background: #fff;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.profile-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

.profile-info dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: #6b6b80;
  margin-top: 0.75rem;
}

.profile-info dd {
  font-size: 1rem;
  color: #1a1a2e;
  margin-left: 0;
}

.profile-info dt:first-child {
  margin-top: 0;
}

/* Rate Limits Table */

.rate-limits-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.rate-limits-table th,
.rate-limits-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e8;
}

.rate-limits-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  color: #6b6b80;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rate-limits-table td {
  font-size: 0.95rem;
}

.rate-limits-table tbody tr:hover {
  background: #f8f9fa;
}

/* Hidden utility */

.hidden {
  display: none !important;
}

/* Loading spinner */

.loading-spinner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.loading-spinner p {
  margin: 0;
  color: #6b6b80;
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e0e0e8;
  border-top-color: #4a6cf7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Inline form row */

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.inline-form .btn {
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 1px;
}

/* Manage Account link in footer */

footer .manage-account-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.7rem 1.75rem;
  background: linear-gradient(135deg, #4a6cf7 0%, #3a5ce5 100%);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(74, 108, 247, 0.25);
}

footer .manage-account-link:hover,
footer .manage-account-link:focus {
  background: linear-gradient(135deg, #3a5ce5 0%, #2e4fd4 100%);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.35);
  transform: translateY(-1px);
}

footer .manage-account-link:focus-visible {
  outline: 2px solid #4a6cf7;
  outline-offset: 2px;
}
