/* ============================================================
   MH6 HOME — TAPO P110 / mhprise
   Neumorphism — static/plug.css
   ============================================================ */

:root {
    --plug-surface: #cbd2da;
    --plug-shadow-dark: rgba(163, 177, 198, 0.58);
    --plug-shadow-light: #e9f1fa;
    --plug-soft-dark: rgba(163, 177, 198, 0.44);
    --plug-soft-light: rgba(255, 255, 255, 0.84);
    --plug-accent: #36d399;
    --plug-accent-soft: rgba(54, 211, 153, 0.20);
}

html[data-theme="dark"] {
    --plug-surface: #20242b;
    --plug-shadow-dark: rgba(9, 11, 14, 0.58);
    --plug-shadow-light: rgba(58, 65, 76, 0.36);
    --plug-soft-dark: rgba(8, 10, 13, 0.46);
    --plug-soft-light: rgba(62, 69, 80, 0.24);
    --plug-accent-soft: rgba(54, 211, 153, 0.14);
}

.plug-section {
    width: 100%;
    max-width: 620px;
    margin: 72px auto 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plug-section-heading {
    width: 100%;
    margin-bottom: 22px;
    text-align: center;
}

.plug-section-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.45;
}

.plug-section-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.2;
}

.plug-card {
    width: min(100%, 520px);
    box-sizing: border-box;
    padding: 26px;
    border: 0;
    border-radius: 28px;
    background: var(--plug-surface);
    box-shadow:
        12px 12px 26px var(--plug-shadow-dark),
        -12px -12px 26px var(--plug-shadow-light);
    transition:
        box-shadow 180ms ease,
        transform 180ms ease,
        opacity 180ms ease;
}

.plug-card.is-on {
    box-shadow:
        12px 12px 26px var(--plug-shadow-dark),
        -12px -12px 26px var(--plug-shadow-light),
        0 0 0 1px rgba(54, 211, 153, 0.08);
}

.plug-card.busy {
    pointer-events: none;
    opacity: 0.68;
}

.plug-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.plug-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.plug-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: var(--plug-surface);
    box-shadow:
        inset 4px 4px 8px var(--plug-soft-dark),
        inset -4px -4px 8px var(--plug-soft-light);
    transition: color 180ms ease;
}

.plug-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.62;
}

.plug-card.is-on .plug-icon {
    color: var(--plug-accent);
    box-shadow:
        inset 4px 4px 8px var(--plug-soft-dark),
        inset -4px -4px 8px var(--plug-soft-light);
}

.plug-card.is-on .plug-icon svg {
    opacity: 1;
}

.plug-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plug-title strong {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plug-title span {
    font-size: 0.82rem;
    opacity: 0.48;
}

/* interrupteur neumorphique */
.plug-switch {
    position: relative;
    width: 64px;
    height: 36px;
    flex: 0 0 64px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--plug-surface);
    box-shadow:
        inset 4px 4px 8px var(--plug-soft-dark),
        inset -4px -4px 8px var(--plug-soft-light);
    cursor: pointer;
    transition: box-shadow 180ms ease, background 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.plug-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--plug-surface);
    box-shadow:
        4px 4px 8px var(--plug-soft-dark),
        -4px -4px 8px var(--plug-soft-light);
    transition:
        transform 190ms cubic-bezier(.2,.8,.2,1),
        background 180ms ease,
        box-shadow 180ms ease;
}

.plug-card.is-on .plug-switch {
    background: var(--plug-accent-soft);
    box-shadow:
        inset 4px 4px 8px rgba(20, 95, 68, 0.24),
        inset -4px -4px 8px rgba(113, 255, 204, 0.16);
}

.plug-card.is-on .plug-switch-thumb {
    transform: translateX(28px);
    background: var(--plug-accent);
    box-shadow:
        3px 3px 7px rgba(20, 95, 68, 0.28),
        -2px -2px 7px rgba(113, 255, 204, 0.16);
}

.plug-switch:active .plug-switch-thumb {
    box-shadow:
        inset 2px 2px 5px var(--plug-soft-dark),
        inset -2px -2px 5px var(--plug-soft-light);
}

.plug-switch:focus-visible {
    outline: 2px solid var(--plug-accent);
    outline-offset: 5px;
}

.plug-power-readout {
    margin: 28px 0 20px;
    padding: 23px 20px;
    text-align: center;
    border-radius: 20px;
    background: var(--plug-surface);
    box-shadow:
        inset 5px 5px 11px var(--plug-soft-dark),
        inset -5px -5px 11px var(--plug-soft-light);
}

.plug-power-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0.44;
}

.plug-power-readout div {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
}

.plug-power-readout strong {
    font-size: clamp(2.1rem, 8vw, 3.2rem);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
}

.plug-power-readout div > span {
    font-size: 1rem;
    font-weight: 650;
    opacity: 0.46;
}

.plug-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.plug-metric {
    min-width: 0;
    padding: 14px 10px;
    text-align: center;
    border-radius: 16px;
    background: var(--plug-surface);
    box-shadow:
        5px 5px 11px var(--plug-soft-dark),
        -5px -5px 11px var(--plug-soft-light);
}

.plug-metric > span {
    display: block;
    margin-bottom: 5px;
    font-size: 0.68rem;
    opacity: 0.42;
}

.plug-metric strong {
    display: block;
    overflow: hidden;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .plug-section {
        margin-top: 54px;
        padding-inline: 4px;
        box-sizing: border-box;
    }

    .plug-card {
        width: 100%;
        padding: 20px;
        border-radius: 24px;
        box-shadow:
            9px 9px 20px var(--plug-shadow-dark),
            -9px -9px 20px var(--plug-shadow-light);
    }

    .plug-metrics {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .plug-metric {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 13px 15px;
        text-align: left;
    }

    .plug-metric > span {
        margin: 0;
    }
}
