/* ========================================
   Painel SDW For All
   Refined institutional aesthetic
   ======================================== */

:root {
    --sdw-teal: #2A7B7D;
    --sdw-teal-dark: #11595B;
    --sdw-teal-light: #358A8C;
    --sdw-gold: #DEA428;
    --sdw-gold-soft: rgba(222, 164, 40, 0.15);
    --sdw-text: #212529;
    --sdw-bg-light: #F8F9FA;
    --sdw-white: #FFFFFF;

    --header-h: 50px;
    --accent-h: 3px;
}

/* ---- Reset ---- */

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: var(--sdw-bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--sdw-teal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    animation: headerSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes headerSlide {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header__logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    /* preserve original logo colors */
    transition: transform 0.3s ease;
}

.header__logo:hover {
    transform: scale(1.04);
}

.header__title {
    color: var(--sdw-white);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.92;
}

.header__title-short {
    display: none;
}

.header__accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--accent-h);
    background: linear-gradient(
        90deg,
        var(--sdw-gold) 0%,
        var(--sdw-gold) 30%,
        var(--sdw-teal-light) 100%
    );
    opacity: 0.85;
}

/* ---- Dashboard ---- */

.dashboard {
    position: fixed;
    top: calc(var(--header-h) + var(--accent-h));
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--sdw-bg-light);
}

.dashboard__iframe {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.dashboard__iframe.loaded {
    opacity: 1;
}

/* ---- Loader ---- */

.dashboard__loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--sdw-bg-light);
    z-index: 10;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.dashboard__loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dashboard__loader-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--sdw-teal);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Water ripple loader */

.ripple {
    position: relative;
    width: 80px;
    height: 80px;
}

.ripple__ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--sdw-teal);
    border-radius: 50%;
    opacity: 0;
    animation: rippleExpand 2.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.ripple__ring:nth-child(1) {
    animation-delay: 0s;
    border-color: var(--sdw-teal);
}

.ripple__ring:nth-child(2) {
    animation-delay: 0.8s;
    border-color: var(--sdw-gold);
}

.ripple__ring:nth-child(3) {
    animation-delay: 1.6s;
    border-color: var(--sdw-teal-light);
}

@keyframes rippleExpand {
    0% {
        transform: scale(0.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .header__title {
        font-size: 14px;
    }

    .header__logo {
        height: 34px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 42px;
    }

    .header {
        padding: 0 14px;
    }

    .header__brand {
        gap: 10px;
    }

    .header__logo {
        height: 28px;
    }

    .header__title {
        font-size: 13px;
    }

    .header__title-full {
        display: none;
    }

    .header__title-short {
        display: inline;
    }
}
