/* Akari · cromo de las páginas públicas y de entrada (landing y selector de servidores).
   Mismo lenguaje que la dashboard: tokens de ds-tokens.css, superficies sólidas, bordes de 1px
   y #FF8000 solo en el CTA principal, estados activos y foco. Ámbito: <body class="ds-site">. */

/* ---------- Base ---------- */
.ds-site {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--ds-bg);
    color: var(--ds-text);
    font-family: var(--ds-font);
    font-size: var(--ds-text-base);
    line-height: 1.5;
    font-feature-settings: var(--ds-font-features);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Reinicios con especificidad cero (:where) para que cualquier componente los sobrescriba. */
:where(.ds-site) *, :where(.ds-site) *::before, :where(.ds-site) *::after { box-sizing: border-box; }
:where(.ds-site) a { color: inherit; }
:where(.ds-site) :where(h1, h2, h3, p) { margin: 0; }
.ds-site ::selection { background: var(--ds-accent-soft); color: var(--ds-text); }
.ds-site :is(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.ds-site [hidden] { display: none !important; }
.ds-site .ds-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ds-site :is(code, kbd, .ds-mono) { font-family: var(--ds-font-mono); font-feature-settings: normal; }
.ds-site kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--ds-border); border-radius: 4px; background: var(--ds-surface); color: var(--ds-text-3); font-size: 11px; line-height: 16px; text-align: center; }
.ds-site .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Botón nativo para vaciar búsquedas: aspa neutra en lugar del azul del navegador. */
.ds-site input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: var(--ds-text-3);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 14px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 14px no-repeat;
    cursor: pointer;
}
.ds-site input[type="search"]::-webkit-search-cancel-button:hover { background-color: var(--ds-text); }

.site-container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.site-main { flex: 1 0 auto; }
.site-main:focus { outline: none; }

.ds-skip-link { position: fixed; top: 12px; left: 12px; z-index: 200; padding: 8px 12px; border-radius: var(--ds-radius-sm); background: var(--ds-text); color: var(--ds-bg); font-size: var(--ds-text-sm); font-weight: 500; text-decoration: none; transform: translateY(-200%); }
.ds-skip-link:focus { transform: none; }

/* ---------- Botones ---------- */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-button, 10px);
    background: transparent;
    color: var(--ds-text);
    font: inherit;
    font-size: var(--ds-text-sm);
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--ds-ease), border-color var(--ds-ease), color var(--ds-ease);
}
.ds-btn-lg { height: 40px; padding: 0 16px; font-size: var(--ds-text-base); }
.ds-btn-primary { border-color: var(--ds-accent); background: var(--ds-accent); color: var(--ds-on-accent); font-weight: 600; }
.ds-btn-primary:hover { border-color: var(--ds-accent-hover); background: var(--ds-accent-hover); color: var(--ds-on-accent); }
.ds-btn-secondary { border-color: var(--ds-border); background: var(--ds-surface); box-shadow: var(--ds-shadow-card); }
.ds-btn-secondary:hover { border-color: var(--ds-border-strong); background: var(--ds-surface-hover); }
.ds-btn-secondary .ds-icon { color: var(--ds-text-2); }
.ds-btn-ghost { color: var(--ds-text-2); }
.ds-btn-ghost:hover { background: var(--ds-nav-hover); color: var(--ds-text); }
.ds-btn:disabled, .ds-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.ds-icon-button { width: 36px; padding: 0; }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ds-border); background: var(--ds-bg); }
.site-header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.site-brand { display: inline-flex; flex: none; align-items: center; gap: 10px; color: var(--ds-text); font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.site-brand img { width: 28px; height: 28px; border-radius: var(--ds-radius-sm); object-fit: cover; }
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.site-nav a { padding: 6px 10px; border-radius: var(--ds-radius-sm); color: var(--ds-text-2); font-size: var(--ds-text-sm); font-weight: 500; text-decoration: none; transition: background-color var(--ds-ease), color var(--ds-ease); }
.site-nav a:hover { background: var(--ds-nav-hover); color: var(--ds-text); }
.site-nav a[aria-current="page"] { color: var(--ds-text); }
.site-actions { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }
.site-nav + .site-actions { margin-left: 0; }

/* Menús desplegables (cuenta, navegación móvil y tema) */
.site-menu { position: relative; display: inline-flex; }
.site-menu-panel,
.ds-site .public-theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 200px;
    padding: 4px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-overlay);
}
:root.dark .site-menu-panel, :root.dark .ds-site .public-theme-menu { border-color: var(--ds-border-strong); }
.site-menu-head { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--ds-border); margin-bottom: 4px; }
.site-menu-head strong { overflow: hidden; color: var(--ds-text); font-size: var(--ds-text-sm); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.site-menu-head span { color: var(--ds-text-3); font-size: var(--ds-text-xs); }
.site-menu-panel a,
.ds-site .public-theme-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--ds-radius-sm);
    background: transparent;
    color: var(--ds-text);
    font: inherit;
    font-size: var(--ds-text-sm);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.site-menu-panel a .ds-icon,
.ds-site .public-theme-menu .ds-icon { color: var(--ds-text-3); }
.site-menu-panel a:is(:hover, :focus-visible),
.ds-site .public-theme-menu button:is(:hover, :focus-visible) { outline: none; background: var(--ds-nav-hover); }
/* Dentro de un menú, el foco de teclado se marca con fondo y filete, no con el anillo naranja. */
.ds-site :is(.site-menu-panel a, .public-theme-menu button, .site-mobile-nav a):focus-visible { outline: none; background: var(--ds-nav-active); box-shadow: inset 0 0 0 1px var(--ds-border-strong); }
.ds-site .public-theme-menu button[aria-pressed="true"] { background: var(--ds-nav-active); }
.ds-site .public-theme-menu button[aria-pressed="true"] .ds-icon { color: var(--ds-text); }
.site-menu-separator { height: 1px; margin: 4px 0; border: 0; background: var(--ds-border); }
.site-menu-panel .is-danger { color: var(--ds-danger); }
.site-menu-panel .is-danger .ds-icon { color: currentColor; }

.ds-site .public-theme-control { position: relative; display: inline-flex; flex: none; }
.ds-site .public-theme-trigger .ds-icon { display: none; }
html:not([data-theme-choice="dark"]):not([data-theme-choice="system"]) .ds-site .public-theme-trigger .theme-icon-light,
html[data-theme-choice="dark"] .ds-site .public-theme-trigger .theme-icon-dark,
html[data-theme-choice="system"] .ds-site .public-theme-trigger .theme-icon-system { display: block; }
.ds-site .public-theme-menu { min-width: 160px; }
.ds-site .public-theme-trigger {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-card);
    color: var(--ds-text-2);
    cursor: pointer;
    transition: border-color var(--ds-ease), color var(--ds-ease);
}
.ds-site .public-theme-trigger:is(:hover, [aria-expanded="true"]) { border-color: var(--ds-border-strong); color: var(--ds-text); }
.ds-site .public-theme-control button:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }

.site-avatar-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.site-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border: 1px solid var(--ds-border);
    border-radius: 50%;
    background: var(--ds-surface-hover);
    color: var(--ds-text-2);
    font-size: 13px;
    font-weight: 600;
}
.site-avatar::before { content: attr(data-initial); }
.site-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.site-avatar-button:hover .site-avatar, .site-avatar-button[aria-expanded="true"] .site-avatar { border-color: var(--ds-border-strong); }

.site-nav-toggle { display: none; }
.site-mobile-nav { position: fixed; top: 64px; right: 0; left: 0; z-index: 49; display: grid; gap: 2px; padding: 8px 16px 16px; border-bottom: 1px solid var(--ds-border); background: var(--ds-bg); box-shadow: var(--ds-shadow-overlay); }
.site-mobile-nav a { display: flex; align-items: center; height: 40px; padding: 0 8px; border-radius: var(--ds-radius-sm); color: var(--ds-text); font-weight: 500; text-decoration: none; }
.site-mobile-nav a:hover { background: var(--ds-nav-hover); }
.site-mobile-nav a[aria-current="page"] { background: var(--ds-nav-active); }

/* ---------- Avisos ---------- */
.site-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); color: var(--ds-text-2); font-size: var(--ds-text-sm); }
.site-notice .ds-icon { color: var(--ds-text-3); }
.site-notice.is-error { border-color: color-mix(in srgb, var(--ds-danger) 35%, transparent); background: color-mix(in srgb, var(--ds-danger) 6%, transparent); color: var(--ds-text); }
.site-notice.is-error .ds-icon { color: var(--ds-danger); }
.site-notice.is-warning { border-color: color-mix(in srgb, var(--ds-warning) 35%, transparent); background: color-mix(in srgb, var(--ds-warning) 6%, transparent); color: var(--ds-text); }
.site-notice a { margin-left: auto; color: var(--ds-text); font-weight: 500; }

/* ---------- Pie ---------- */
.site-footer { flex: none; border-top: 1px solid var(--ds-border); color: var(--ds-text-3); font-size: var(--ds-text-sm); }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-block: 24px; }
.site-footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.site-footer-brand img { width: 18px; height: 18px; border-radius: 4px; opacity: .9; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer-links a { color: var(--ds-text-2); text-decoration: none; transition: color var(--ds-ease); }
.site-footer-links a:hover { color: var(--ds-text); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .site-nav { display: none; }
    .site-nav-toggle { display: grid; }
    .site-actions { margin-left: auto; }
}
@media (max-width: 560px) {
    .site-container { padding-inline: 16px; }
    .site-header-inner { gap: 12px; height: 60px; }
    .site-mobile-nav { top: 60px; }
    .site-brand span { display: none; }
    .site-actions .ds-btn-primary.site-cta { padding: 0 12px; }
    .site-footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .ds-site *, .ds-site *::before, .ds-site *::after { transition: none !important; animation: none !important; }
}
