:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b0d10;
    color: #f7f9fc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-width: 320px;
    min-height: 100%;
    background: #0b0d10;
}

body {
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.sipcore-meet-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 8%, rgba(62, 102, 255, 0.13), transparent 32%),
        radial-gradient(circle at 82% 78%, rgba(40, 132, 255, 0.08), transparent 30%),
        #0b0d10;
}

.meet-centered {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 28px;
}

.brand-row {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.brand-mark,
.header-brand {
    font-weight: 800;
    letter-spacing: -0.045em;
}

.brand-mark {
    font-size: 30px;
}

.meet-product {
    color: #8e98a8;
    font-weight: 600;
}

.loading-line {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #aab2bf;
}

.spinner,
.button-spinner {
    display: inline-block;
    border-radius: 50%;
    border-style: solid;
    animation: sipcore-spin 0.8s linear infinite;
}

.spinner {
    width: 22px;
    height: 22px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
}

.button-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

@keyframes sipcore-spin {
    to { transform: rotate(360deg); }
}

.status-card {
    width: min(460px, 100%);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    background: rgba(20, 24, 30, 0.95);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.status-card h1 {
    margin: 14px 0 10px;
    font-size: 27px;
    letter-spacing: -0.03em;
}

.status-card p {
    margin: 0;
    color: #aeb6c2;
    line-height: 1.6;
}

.status-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(226, 73, 73, 0.14);
    color: #ff8b86;
    font-weight: 800;
}

.prejoin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(360px, 0.52fr);
}

.prejoin-preview-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 48px;
}

.prejoin-preview-wrap {
    position: relative;
    width: min(100%, 1080px);
}

.video-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 28px;
    background: #15191f;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.42);
}

.preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #8d96a3;
}

.avatar-circle,
.participant-avatar {
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(145deg, #343c48, #242a33);
    color: #ffffff;
    font-weight: 750;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.avatar-circle {
    width: 112px;
    height: 112px;
    font-size: 34px;
}

.preview-placeholder-text {
    font-size: 14px;
}

.preview-controls {
    position: absolute;
    left: 50%;
    bottom: 24px;
    display: flex;
    gap: 12px;
    transform: translateX(-50%);
}

.preview-button,
.toolbar-button {
    border: 0;
    color: white;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.preview-button:hover,
.toolbar-button:hover {
    transform: translateY(-1px);
}

.preview-button {
    min-width: 78px;
    height: 48px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(47, 53, 62, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.preview-button.disabled-control,
.toolbar-button.disabled-control {
    background: #b93632;
}

.control-icon {
    font-size: 13px;
    font-weight: 700;
}

.prejoin-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 54px 52px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(15, 18, 23, 0.9);
    backdrop-filter: blur(18px);
}

.meeting-company {
    margin-top: 34px;
    color: #85a3ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.prejoin-panel h1 {
    margin: 10px 0 12px;
    max-width: 560px;
    font-size: clamp(31px, 3vw, 48px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.meeting-description {
    margin: 0;
    color: #aab2bf;
    line-height: 1.65;
}

.meeting-status-row {
    margin: 22px 0 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.live {
    background: rgba(50, 181, 91, 0.13);
    color: #7ce19b;
}

.status-pill.waiting {
    background: rgba(229, 173, 48, 0.12);
    color: #edc76b;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #69dc8c;
    box-shadow: 0 0 0 4px rgba(105, 220, 140, 0.1);
}

.info-banner,
.error-banner {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.5;
}

.info-banner {
    background: rgba(86, 123, 237, 0.11);
    color: #b8c8ff;
}

.error-banner {
    background: rgba(205, 63, 60, 0.12);
    color: #ff9b95;
}

.form-group {
    margin-top: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #d6dbe3;
    font-size: 13px;
    font-weight: 650;
}

.optional-text {
    color: #747f8f;
    font-weight: 500;
}

.meet-input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #343b46;
    border-radius: 12px;
    outline: none;
    background: #15191f;
    color: #ffffff;
    transition: border 120ms ease, box-shadow 120ms ease;
}

.meet-input:focus {
    border-color: #5b7df0;
    box-shadow: 0 0 0 3px rgba(91, 125, 240, 0.12);
}

.meet-input::placeholder {
    color: #687281;
}

.join-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #5477ec, #3d61d7);
    color: #ffffff;
    cursor: pointer;
    font-weight: 750;
    box-shadow: 0 14px 35px rgba(62, 93, 205, 0.24);
}

.join-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    box-shadow: none;
}

.join-help {
    margin: 14px 0 0;
    color: #798393;
    font-size: 12px;
    line-height: 1.55;
}

.meeting-code-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #727d8d;
    font-size: 12px;
}

.meeting-code-row strong {
    color: #b8c0cb;
    letter-spacing: 0.04em;
}

.meeting-room {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 68px minmax(0, 1fr) 92px;
    background: #0a0c0f;
}

.meeting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(12, 14, 18, 0.94);
}

.meeting-header-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-brand {
    flex: 0 0 auto;
    font-size: 20px;
}

.header-divider {
    width: 1px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
}

.header-meeting-text {
    min-width: 0;
}

.header-title,
.header-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-title {
    max-width: min(52vw, 640px);
    color: #e7eaf0;
    font-size: 14px;
    font-weight: 650;
}

.header-subtitle {
    margin-top: 2px;
    color: #6f7988;
    font-size: 11px;
}

.participant-count {
    color: #8993a2;
    font-size: 13px;
}

.meeting-stage {
    min-height: 0;
    overflow: hidden;
}

.video-grid {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: minmax(260px, 1fr);
    gap: 12px;
    align-content: center;
    padding: 14px;
    overflow: auto;
}

.participant-tile {
    position: relative;
    min-width: 0;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 18px;
    background: #15191f;
}

.participant-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.participant-avatar {
    width: 94px;
    height: 94px;
    font-size: 29px;
}

.participant-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.local-camera-video {
    transform: scaleX(-1);
}

.screen-share-video {
    object-fit: contain;
    transform: none !important;
    background: #050607;
}

.participant-audio {
    display: none;
}

.participant-footer {
    position: absolute;
    z-index: 5;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.participant-name,
.participant-media-state {
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(5, 7, 10, 0.66);
    backdrop-filter: blur(8px);
    font-size: 12px;
}

.participant-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-media-state {
    color: #ffaaa5;
}

.meeting-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(12, 14, 18, 0.96);
}

.toolbar-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
}

.toolbar-button {
    min-width: 76px;
    height: 48px;
    padding: 0 15px;
    border-radius: 999px;
    background: #2e343d;
    font-size: 12px;
    font-weight: 700;
}

.toolbar-button.active {
    background: #303741;
}

.toolbar-button.leave {
    min-width: 92px;
    background: #c83b36;
}

@media (max-width: 980px) {
    .prejoin-shell {
        grid-template-columns: 1fr;
    }

    .prejoin-preview-section {
        min-height: 48vh;
        padding: 24px;
    }

    .prejoin-panel {
        padding: 34px 24px 48px;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        border-left: 0;
    }

    .meeting-company {
        margin-top: 24px;
    }
}

@media (max-width: 680px) {
    .prejoin-preview-section {
        min-height: auto;
        padding: 14px;
    }

    .video-preview {
        border-radius: 18px;
    }

    .preview-controls {
        bottom: 14px;
    }

    .preview-button {
        min-width: 66px;
        height: 44px;
        padding: 0 12px;
    }

    .prejoin-panel h1 {
        font-size: 34px;
    }

    .header-divider,
    .header-subtitle,
    .participant-count {
        display: none;
    }

    .header-title {
        max-width: 62vw;
    }

    .video-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(220px, 1fr);
        padding: 8px;
        gap: 8px;
    }

    .meeting-toolbar {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .toolbar-group {
        min-width: max-content;
        margin: auto;
    }

    .toolbar-button {
        min-width: 68px;
        height: 46px;
        padding: 0 12px;
    }
}
