/* WAP · Portal de herramientas · mismo sistema visual que Human Allocation, Inventory, Project Dashboard y Mailing */

:root {
    --wap-bg: #CDD3B6;
    --wap-ink: #111111;
    --wap-ink-hover: #2A2A2A;
    --wap-surface: #FFFFFF;
    --wap-surface-soft: #F5F6F2;
    --wap-text-muted: #686B60;
    --wap-border: rgba(17, 17, 17, 0.16);
    --wap-border-strong: rgba(17, 17, 17, 0.30);
    --wap-shadow: 0 2px 8px rgba(17, 17, 17, 0.06);
    --wap-focus: 0 0 0 3px rgba(17, 17, 17, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; background: var(--wap-bg); color: var(--wap-ink); font-family: Arial, Helvetica, sans-serif; }
::selection { background: var(--wap-ink); color: #fff; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--wap-focus); }

/* Acceso */
body:has(.login-card) { display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-card { width: 100%; max-width: 520px; padding: 48px; background: var(--wap-surface); border: 1px solid var(--wap-border); text-align: center; }
.login-card__logo { display: block; width: 180px; height: auto; margin: 0 auto 36px; }
.login-card h1 { margin: 0 0 18px; font-size: 32px; line-height: 1.2; }
.login-card p { max-width: 360px; margin: 0 auto 36px; color: var(--wap-text-muted); font-size: 16px; line-height: 1.7; }
.login-card .notice { max-width: none; padding: 12px 14px; background: #FAEEEE; color: #9F2F2F; font-size: 14px; line-height: 1.5; }
.login-card .version { margin: 34px 0 0; font-size: 12px; }
.button { display: inline-block; padding: 16px 34px; background: var(--wap-ink); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; transition: background .2s; }
.button:hover { background: var(--wap-ink-hover); }

/* Portal */
.portal { display: flex; flex-direction: column; min-height: 100vh; }
.portal__top { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 18px 28px; }
.portal__top form { margin: 0; }
.portal__user { font-size: 13px; font-weight: 700; }
.portal__logout { min-height: 34px; padding: 6px 12px; border: 1px solid var(--wap-border-strong); background: transparent; color: var(--wap-ink); font: 700 12px Arial, Helvetica, sans-serif; cursor: pointer; }
.portal__logout:hover { background: var(--wap-ink); color: #fff; }
.portal__main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; text-align: center; }
.portal__logo { display: block; width: 220px; height: auto; margin: 12px auto 26px; }
.portal__greeting { margin: 0 0 44px; color: var(--wap-text-muted); font-size: 16px; }
.portal__footer { padding: 20px 28px 28px; font-size: 12px; color: var(--wap-text-muted); text-align: center; }

.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; text-align: left; }
.tool {
    position: relative; display: flex; flex-direction: column; min-height: 290px; padding: 20px 20px 22px;
    background: var(--wap-surface); border: 1px solid var(--wap-border); box-shadow: var(--wap-shadow);
    color: var(--wap-ink); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tool:hover, .tool:focus-visible { transform: translateY(-3px); border-color: var(--wap-border-strong); box-shadow: 0 14px 30px rgba(17, 17, 17, .10); }

/* Ilustración: ocupa todo el ancho del texto, sobre un verde algo más oscuro que el fondo. */
.tool__icon {
    display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 22px; padding: 7% 6%;
    background: #BCC3A3; overflow: hidden;
}
.tool__icon img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .25s; }
.tool:hover .tool__icon img, .tool:focus-visible .tool__icon img { transform: translateY(-4px) scale(1.03); }

.tool__name { font-size: 21px; font-weight: 700; line-height: 1.2; margin-bottom: 10px; }
.tool__description { color: var(--wap-text-muted); font-size: 14px; line-height: 1.6; }
.tool__open { margin-top: auto; padding-top: 22px; font-size: 13px; font-weight: 700; }
.tool__open span { display: inline-block; transition: transform .18s; }
.tool:hover .tool__open span { transform: translateX(4px); }

@media (max-width: 1080px) {
    .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool { min-height: 240px; }
}
@media (max-width: 600px) {
    .portal__top { padding: 14px 16px; }
    .portal__user { display: none; }
    .portal__main { padding: 8px 16px 32px; }
    .portal__logo { width: 170px; margin-bottom: 18px; }
    .portal__greeting { margin-bottom: 28px; }
    .tools { grid-template-columns: 1fr; gap: 14px; }
    .tool { min-height: 0; padding: 16px 16px 18px; }
    .tool__icon { aspect-ratio: 16 / 8; margin-bottom: 16px; }
    .tool__name { font-size: 18px; margin-bottom: 4px; }
    .tool__open { padding-top: 12px; }
    body:has(.login-card) { padding: 20px; }
    .login-card { padding: 38px 24px; }
}
@media (prefers-reduced-motion: reduce) { .tool, .tool__icon img, .tool__open span { transition: none; } }
