/*
 * Language Kingdom — estilos comunes
 * Cargado por: index.php, client_login.php, seleccion.php (y futuros)
 * Variables de marca, reset, tipografía y componentes reutilizados.
 */

:root {
    --navy: #0B2545;
    --navy-light: #13315C;
    --gold: #C6982F;
    --gold-light: #E8C468;
    --gold-soft: #FDF5E6;
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 25px 50px -12px rgba(0,0,0,.4);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--gray-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
}

a { color: inherit; }

/* ── Layout login (navy fondo, tarjeta blanca) ── */
.lk-login-body {
    background: var(--navy);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lk-login-container {
    width: 100%;
    max-width: 440px;
    padding: 0 24px;
}

.lk-login-brand {
    text-align: center;
    margin-bottom: 48px;
}

.lk-login-brand .lk-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.lk-login-brand .lk-name .lk {
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
}

.lk-login-brand .lk-brand-logo {
    display: block;
    max-width: 190px;
    max-height: 52px;
    object-fit: contain;
}

.lk-login-brand .lk-brand-logo-login {
    max-width: min(320px, 100%);
    max-height: 78px;
}

.lk-login-brand .lk-name span {
    color: var(--white);
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: .5px;
}

.lk-login-brand p {
    color: rgba(255,255,255,.5);
    font-size: 14px;
}

.lk-login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.lk-login-card h2 {
    font-size: 22px;
    margin-bottom: 6px;
    text-align: center;
}

.lk-login-card .subtitle {
    color: var(--gray-500);
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.lk-login-footer {
    text-align: center;
    margin-top: 32px;
    color: rgba(255,255,255,.35);
    font-size: 12px;
}

.lk-login-footer a {
    color: rgba(255,255,255,.5);
    text-decoration: none;
    transition: color .2s;
}

.lk-login-footer a:hover { color: var(--gold-light); }

/* ── Banderas país ── */
.lk-country-flags {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.lk-country-flags span {
    font-size: 28px;
    opacity: .7;
    transition: opacity .3s;
}

.lk-country-flags span:hover { opacity: 1; }

/* ── Mensajes ── */
.lk-error-msg {
    background: #FEF2F2;
    color: #DC2626;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #FECACA;
}

.lk-info-msg {
    background: #EFF6FF;
    color: #1D4ED8;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #BFDBFE;
}

/* ── Formularios ── */
.lk-form-group { margin-bottom: 20px; }

.lk-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
    letter-spacing: .3px;
}

.lk-input-wrap { position: relative; }

.lk-input-wrap input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    color: var(--gray-700);
    background: var(--gray-50);
    transition: all .2s;
    outline: none;
}

.lk-input-wrap input:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(198,152,47,.12);
}

.lk-toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    transition: color .2s;
}

.lk-toggle-pw:hover { color: var(--gray-600); }

.lk-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s;
    letter-spacing: .3px;
}

.lk-submit-btn:hover:not(:disabled) {
    background: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198,152,47,.3);
}

.lk-submit-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Botón Google OAuth ── */
.lk-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    color: #3c4043;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.lk-google-btn:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 18px rgba(15,23,42,.08);
    transform: translateY(-1px);
}

.lk-google-btn svg { flex-shrink: 0; }

.lk-oauth-note {
    margin-top: 12px;
    color: var(--gray-500);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}

.lk-form-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lk-form-separator::before,
.lk-form-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.lk-temp-login-form {
    margin-top: 0;
}

.lk-temp-note {
    margin: 12px 0 0;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/* ── Dashboard interno ── */
.lk-dashboard-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(198,152,47,.16), transparent 32%),
        radial-gradient(circle at top right, rgba(19,49,92,.22), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
    padding: 40px 20px 56px;
}

.lk-dashboard-head,
.lk-dashboard-panel {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.lk-dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.lk-dashboard-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 20px;
    background: var(--navy);
    border-radius: 999px;
    box-shadow: 0 18px 36px rgba(11,37,69,.22);
}

.lk-dashboard-user-name {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .01em;
}

.lk-dashboard-role {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
}

.lk-dashboard-subtitle {
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lk-dashboard-grid {
    display: grid;
    gap: 18px;
}

.lk-dashboard-grid.compact {
    max-width: 980px;
    margin: 0 auto 30px;
    grid-template-columns: repeat(3, minmax(0, 96px));
    justify-content: start;
}

.lk-dashboard-panel {
    background: rgba(255,255,255,.74);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 28px;
    box-shadow: 0 28px 60px rgba(15,23,42,.12);
    padding: 28px;
}

.lk-dashboard-panel h1 {
    font-size: 34px;
    margin-bottom: 8px;
}

.lk-dashboard-panel > p {
    color: var(--gray-500);
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 720px;
}

.lk-dashboard-grid.detail {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lk-tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 190px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(148,163,184,.18);
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(15,23,42,.08);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.lk-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15,23,42,.12);
    border-color: rgba(198,152,47,.45);
}

.lk-tool-card.primary {
    background: linear-gradient(160deg, #18396a 0%, #0b2545 100%);
    color: var(--white);
}

.lk-tool-card.ghost {
    background: linear-gradient(160deg, #fbfdff 0%, #f1f5f9 100%);
}

.lk-tool-card.compact {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 12px;
    border-radius: 28px;
    text-align: center;
}

.lk-tool-card.compact .lk-tool-copy {
    display: none;
}

.lk-tool-card.compact.primary {
    background: linear-gradient(160deg, #18396a 0%, #0b2545 100%);
}

.lk-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(198,152,47,.14);
    color: var(--navy);
    font-size: 26px;
    line-height: 1;
}

.lk-tool-card.primary .lk-tool-icon {
    background: rgba(255,255,255,.12);
    color: var(--gold-light);
}

.lk-tool-card.compact .lk-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
}

.lk-tool-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.lk-tool-card.compact .lk-tool-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lk-tool-copy {
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.55;
}

.lk-tool-card.primary .lk-tool-copy {
    color: rgba(255,255,255,.76);
}

.lk-tool-copy code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .92em;
}

/* ── Empty state genérico ── */
.lk-empty-state {
    text-align: center;
    padding: 80px 40px;
}

.lk-empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.lk-empty-state p { color: var(--gray-500); }

/* ── Accesibilidad: focus visible para navegación por teclado ── */
:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Quitamos el outline default para mouse, lo dejamos solo en :focus-visible */
:focus:not(:focus-visible) {
    outline: none;
}

/* Botones e inputs ya tienen estilos de focus propios; les quitamos el outline */
.lk-input-wrap input:focus-visible,
.lk-submit-btn:focus-visible,
.lk-google-btn:focus-visible {
    outline-offset: 4px;
}

/* Skip link para usuarios con teclado/lector de pantalla */
.lk-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gold);
    color: var(--navy);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 0 0 8px 0;
    z-index: 10000;
}
.lk-skip-link:focus {
    top: 0;
}

/* Mejor contraste en links del footer (era rgba .35 — bajo en contraste) */
.lk-login-footer { color: rgba(255,255,255,.55); }
.lk-login-footer a { color: rgba(255,255,255,.7); }

/* Reduce motion para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .lk-login-card { padding: 28px 24px; }
    .lk-login-brand .lk-name .lk { font-size: 28px; }
    .lk-login-brand .lk-name span { font-size: 18px; }
    .lk-dashboard-shell { padding: 24px 14px 32px; }
    .lk-dashboard-head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 22px;
    }
    .lk-dashboard-user {
        width: 100%;
        justify-content: space-between;
        padding-left: 16px;
    }
    .lk-dashboard-user-name { font-size: 16px; }
    .lk-dashboard-subtitle { font-size: 12px; }
    .lk-dashboard-grid.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 20px;
    }
    .lk-dashboard-panel {
        padding: 22px 18px;
        border-radius: 22px;
    }
    .lk-dashboard-panel h1 { font-size: 28px; }
    .lk-dashboard-grid.detail { grid-template-columns: 1fr; }
    .lk-tool-card { min-height: 168px; }
}
