/* =========================================================
   CONTEMPLA — CAPA VISUAL CORPORATIVA
   Azul corporativo extraído del logo: #001D6D
   ========================================================= */

:root {
    --brand-blue: #001d6d;
    --brand-blue-2: #0a3a9a;
    --brand-blue-soft: #edf2ff;
    --brand-ink: #0d1b2a;

    --background: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-hover: #f8faff;
    --text: #14202b;
    --muted: #687585;
    --border: #dce4ef;

    --primary: var(--brand-blue);
    --primary-hover: #001756;
    --primary-soft: var(--brand-blue-soft);

    --radius: 20px;
    --radius-small: 12px;

    --shadow:
        0 1px 2px rgba(18, 33, 57, 0.04),
        0 10px 28px rgba(30, 52, 89, 0.08);
    --shadow-hover:
        0 18px 45px rgba(0, 29, 109, 0.14),
        0 4px 12px rgba(20, 32, 43, 0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 2%, rgba(0, 29, 109, 0.08), transparent 27rem),
        radial-gradient(circle at 92% 16%, rgba(61, 128, 224, 0.07), transparent 24rem),
        linear-gradient(180deg, #f8faff 0%, var(--background) 46%, #f5f7fb 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
    opacity: 0.5;
}

body::before {
    top: 19%;
    left: -170px;
    background: rgba(0, 29, 109, 0.08);
    animation: contempla-float 13s ease-in-out infinite;
}

body::after {
    right: -185px;
    bottom: 4%;
    background: rgba(32, 111, 217, 0.07);
    animation: contempla-float 16s ease-in-out infinite reverse;
}

/* Topbar corporativa */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(208, 220, 235, 0.82);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 8px 32px rgba(24, 43, 77, 0.035);
}

.topbar-inner {
    max-width: 1320px;
    min-height: 78px;
    gap: 26px;
}

.brand {
    position: relative;
    min-width: 164px;
    padding: 6px 0;
    transition: transform 180ms ease, filter 180ms ease;
}

.brand:hover {
    transform: translateY(-1px) scale(1.018);
    filter: drop-shadow(0 6px 10px rgba(0, 29, 109, 0.10));
}

.brand-logo {
    display: block;
    width: 164px;
    max-width: 100%;
    height: auto;
}

.brand-product-badge {
    position: absolute;
    right: 0;
    bottom: -2px;
    padding: 2px 7px;
    border: 1px solid rgba(0, 29, 109, 0.14);
    border-radius: 999px;
    background: rgba(237, 242, 255, 0.96);
    color: var(--brand-blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav {
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(215, 225, 238, 0.72);
    border-radius: 999px;
    background: rgba(248, 250, 254, 0.78);
}

.nav a {
    position: relative;
    padding: 8px 11px;
    border-radius: 999px;
    color: #586879;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.nav a:hover {
    color: var(--brand-blue);
    background: rgba(0, 29, 109, 0.055);
    transform: translateY(-1px);
}

.nav a.is-active {
    color: #fff;
    background: var(--brand-blue);
    box-shadow: 0 6px 14px rgba(0, 29, 109, 0.20);
}

.user-area {
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border: 1px solid rgba(0, 29, 109, 0.13);
    border-radius: 50%;
    background: linear-gradient(145deg, #f2f6ff, #e4ebfb);
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 #fff;
}

.user-name {
    color: #263445;
}

/* Layout y entrada */
.page {
    width: min(1180px, calc(100% - 42px));
    padding-top: 48px;
}

.page-heading,
.welcome {
    position: relative;
    animation: contempla-rise 480ms cubic-bezier(.2,.8,.2,1) both;
}

.page-heading::before,
.welcome::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 4px;
    width: 4px;
    height: 46px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand-blue), #5a8fe5);
    box-shadow: 0 0 18px rgba(0, 29, 109, 0.15);
}

.eyebrow {
    color: var(--brand-blue);
}

h1 {
    color: #111d2a;
    font-weight: 740;
    letter-spacing: -0.04em;
}

h2,
h3 {
    color: #1b2938;
}

.page-description {
    color: #687789;
}

/* Cards */
.resource-grid {
    gap: 22px;
}

.resource-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border-color: rgba(212, 223, 237, 0.9);
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0, 29, 109, 0.07), transparent 45%),
        rgba(255, 255, 255, 0.93);
    box-shadow: var(--shadow);
    transition:
        transform 220ms cubic-bezier(.2,.8,.2,1),
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.resource-card::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-105%);
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.62) 48%, transparent 66%);
    transition: transform 650ms ease;
    pointer-events: none;
}

.resource-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 29, 109, 0.22);
    box-shadow: var(--shadow-hover);
}

.resource-card:hover::after {
    transform: translateX(105%);
}

.resource-icon {
    width: 60px;
    height: 60px;
    border: 1px solid rgba(0, 29, 109, 0.10);
    border-radius: 18px;
    background: linear-gradient(145deg, #f1f5ff, #e6edff);
    color: var(--brand-blue);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}

.resource-icon svg {
    width: 29px;
    height: 29px;
}

.resource-card:hover .resource-icon {
    transform: rotate(-4deg) scale(1.08);
}

.resource-arrow {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.resource-card:hover .resource-arrow {
    transform: translateX(4px);
    background: var(--brand-blue);
    color: #fff;
}

.booking-list,
.empty-state,
.date-section,
.parking-map-help,
.current-booking-notice,
.current-assignment-notice {
    border-color: rgba(213, 224, 237, 0.9);
    box-shadow: var(--shadow);
}

.booking-row {
    transition: background 160ms ease, transform 160ms ease;
}

.booking-row:hover {
    background: #f7f9fe;
    transform: translateX(3px);
}

.empty-state {
    background:
        radial-gradient(circle at 50% 0%, rgba(0,29,109,.055), transparent 62%),
        rgba(255,255,255,.9);
}

/* Fechas */
.date-option {
    border-color: rgba(213, 224, 237, 0.92);
    background: rgba(255,255,255,.88);
    box-shadow: 0 5px 15px rgba(23, 43, 78, 0.035);
    transition:
        transform 170ms ease,
        border-color 170ms ease,
        box-shadow 170ms ease,
        background 170ms ease;
}

.date-option:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 29, 109, 0.20);
    box-shadow: 0 9px 22px rgba(0, 29, 109, 0.09);
}

.date-option-active {
    border-color: var(--brand-blue);
    background: linear-gradient(160deg, #062676, var(--brand-blue));
    box-shadow: 0 10px 26px rgba(0, 29, 109, 0.22);
    transform: translateY(-2px);
}

/* Botones y controles */
.button {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition:
        transform 140ms ease,
        box-shadow 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.button:not(:disabled):hover {
    transform: translateY(-1px);
}

.button:not(:disabled):active {
    transform: translateY(1px) scale(0.985);
}

.button-primary {
    background: linear-gradient(135deg, #001d6d, #0a3a9a);
    box-shadow: 0 8px 18px rgba(0, 29, 109, 0.18);
}

.button-primary:hover {
    background: linear-gradient(135deg, #001756, #073181);
    box-shadow: 0 11px 24px rgba(0, 29, 109, 0.24);
}

.button-secondary {
    border: 1px solid rgba(0, 29, 109, 0.12);
    background: #f2f5fc;
    color: var(--brand-blue);
}

.button-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.42);
    transform: scale(0);
    animation: contempla-ripple 520ms ease-out;
    pointer-events: none;
}

select,
input,
textarea {
    border-color: #cfdae7 !important;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

select:focus,
input:focus,
textarea:focus {
    border-color: rgba(0, 29, 109, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(0, 29, 109, 0.09) !important;
    outline: none;
}

/* Mapas: modernizar contenedor SIN cambiar los colores de estado */
.parking-map-stage,
.office-map-canvas {
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(32, 50, 80, 0.10);
}

.parking-map-stage {
    transition: box-shadow 240ms ease;
}

.parking-map-stage:hover,
.office-map-canvas:hover {
    box-shadow: 0 22px 58px rgba(24, 44, 81, 0.14);
}

.parking-map-space,
.office-map-marker {
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        filter 150ms ease !important;
}

.parking-map-space:hover,
.office-map-marker:hover {
    filter: saturate(1.08) brightness(1.015);
}

/* Dialogs */
dialog {
    box-shadow: 0 30px 80px rgba(8, 21, 43, 0.28) !important;
}

dialog[open] {
    animation: contempla-dialog-in 220ms cubic-bezier(.2,.85,.2,1) both;
}

dialog::backdrop {
    background: rgba(9, 20, 35, 0.48) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: contempla-backdrop-in 180ms ease both;
}

.dialog-close,
.resource-dialog-close {
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.dialog-close:hover,
.resource-dialog-close:hover {
    transform: rotate(90deg) scale(1.06);
}

.dialog-status,
.resource-dialog-status {
    border-radius: 999px;
    font-weight: 700;
}

/* Mensajes */
.message {
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(18, 37, 70, 0.08);
    animation: contempla-message-in 320ms cubic-bezier(.2,.8,.2,1) both;
}

/* Reveal progressivo */
.js-reveal {
    opacity: 0;
    transform: translateY(12px);
}

.js-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 480ms ease var(--reveal-delay, 0ms),
        transform 480ms cubic-bezier(.2,.8,.2,1) var(--reveal-delay, 0ms);
}

/* Login */
.login-body {
    position: relative;
    background:
        radial-gradient(circle at 10% 10%, rgba(37, 91, 179, 0.25), transparent 27rem),
        radial-gradient(circle at 90% 80%, rgba(74, 126, 213, 0.18), transparent 28rem),
        linear-gradient(145deg, #00144d, #001d6d 52%, #06388e);
}

.login-body::before,
.login-body::after {
    z-index: 0;
    opacity: .32;
    background: rgba(255,255,255,.18);
}

.login-container {
    position: relative;
    z-index: 1;
    width: min(460px, calc(100% - 32px));
}

.login-brand {
    margin-bottom: 22px;
    animation: contempla-rise 520ms cubic-bezier(.2,.8,.2,1) both;
}

.login-brand img {
    display: block;
    width: min(330px, 85vw);
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: 17px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 16px 42px rgba(0,0,0,.18);
}

.login-card {
    border: 1px solid rgba(255,255,255,.48);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 28px 80px rgba(0, 8, 36, .34);
    animation: contempla-login-card 560ms 70ms cubic-bezier(.2,.8,.2,1) both;
}

.login-heading h1 {
    color: var(--brand-blue);
}

.login-notice {
    border-color: rgba(0,29,109,.10);
    background: #f5f7fc;
}

/* Responsive */
@media (max-width: 1100px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 8px 18px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .user-area {
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 26px, 1180px);
        padding-top: 34px;
    }

    .topbar-inner {
        padding-left: 13px;
        padding-right: 13px;
    }

    .brand,
    .brand-logo {
        width: 142px;
        min-width: 142px;
    }

    .brand-product-badge {
        display: none;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        display: none;
    }

    .resource-card {
        padding: 22px;
    }

    .page-heading::before,
    .welcome::before {
        left: -9px;
    }
}

/* Animaciones */
@keyframes contempla-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes contempla-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes contempla-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes contempla-message-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes contempla-login-card {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes contempla-ripple {
    to { transform: scale(3.6); opacity: 0; }
}

@keyframes contempla-float {
    0%, 100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(22px,-16px,0); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .js-reveal {
        opacity: 1;
        transform: none;
    }
}


.assignment-resource-icon-parking {
    border: 1px solid rgba(0, 29, 109, 0.10);
    background: linear-gradient(145deg, #f1f5ff, #e6edff);
    color: var(--brand-blue);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.assignment-resource-icon-parking svg {
    width: 29px;
    height: 29px;
}

/* =========================================================
   MICROSOFT CORPORATE LOGIN
   ========================================================= */
.microsoft-login-button {
    width: 100%;
    min-height: 52px;
    margin-top: 22px;
    padding: 12px 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    border: 1px solid #cfd7e3;
    border-radius: 12px;
    background: #ffffff;
    color: #172235;

    font-size: 14px;
    font-weight: 700;
    text-decoration: none;

    box-shadow: 0 5px 16px rgba(21, 38, 67, 0.07);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.microsoft-login-button:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 29, 109, 0.28);
    background: #fbfcff;
    box-shadow: 0 12px 28px rgba(0, 29, 109, 0.12);
}

.microsoft-login-button:active {
    transform: translateY(0);
}

.microsoft-mark {
    width: 19px;
    height: 19px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;

    flex: 0 0 19px;
}

.microsoft-mark span:nth-child(1) { background: #f25022; }
.microsoft-mark span:nth-child(2) { background: #7fba00; }
.microsoft-mark span:nth-child(3) { background: #00a4ef; }
.microsoft-mark span:nth-child(4) { background: #ffb900; }

.microsoft-config-warning {
    margin-top: 22px;
    padding: 14px 15px;

    border: 1px solid #ead493;
    border-radius: 12px;
    background: #fff9e8;
    color: #674f0d;
}

.microsoft-config-warning strong,
.microsoft-config-warning p {
    display: block;
}

.microsoft-config-warning p {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.microsoft-config-warning code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(103, 79, 13, 0.08);
}

.login-messages {
    margin-top: 18px;
}
