/* =====================================================
   ПЕРЕМЕННЫЕ
   ===================================================== */
:root {
    --bg:        #0d0d0f;
    --bg-soft:   #14141a;
    --bg-glow:   #1c1c22;
    --bg-card:   #1a1a22;
    --border:    rgba(201, 169, 110, 0.18);
    --border-hi: rgba(201, 169, 110, 0.45);
    --text:      #e8e6e1;
    --text-dim:  rgba(232, 230, 225, 0.55);
    --accent:    #c9a96e;
}

{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* =====================================================
   ФОН
   ===================================================== */
body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
    position: relative;

    background:
        radial-gradient(ellipse 100% 60% at 50% 0%,
            #2a2a35 0%,
            #14141a 45%,
            #050507 100%),
        linear-gradient(180deg,
            #0a0a0d 0%,
            #050506 100%);
}

body::after {
    content: '';
    position: fixed;
    inset: auto 0 0 0;
    height: 45vh;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(180, 180, 200, 0.06) 60%,
        rgba(200, 200, 220, 0.12) 100%);
    filter: blur(2px);
}

/* =====================================================
   ШАПКА С ЛОГОТИПОМ
   ===================================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    z-index: 20;
    pointer-events: none;
}

.brand-logo {
    height: 64px;
    width: auto;
    opacity: 0.95;
    filter: drop-shadow(0 0 14px rgba(232, 230, 225, 0.25));
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.brand-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* =====================================================
   МАКЕТ
   ===================================================== */
main {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    position: relative;
    z-index: 1;
}

.left-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

/* =====================================================
   КАРДИОГРАММА (белая)
   ===================================================== */
.pulse-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 220px;
    transform: translateY(-50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.75;
    filter: drop-shadow(0 0 8px rgba(232, 230, 225, 0.6));
    overflow: visible;
}

.pulse-line path {
    fill: none;
    stroke: #e8e6e1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1900;
    stroke-dashoffset: 1900;
    animation: ecg 1.4s linear infinite;
}

@keyframes ecg {
    0%   { stroke-dashoffset: 1900; }
    100% { stroke-dashoffset: 0;    }
}

/* =====================================================
   КРУГЛАЯ КНОПКА С ТЕКСТОМ
   ===================================================== */
.btn-enter {
    position: relative;
    z-index: 3;

    width: clamp(200px, 22vw, 300px);
    height: clamp(200px, 22vw, 300px);
    border-radius: 50%;
    padding-left: 0.08em;

    font-family: inherit;
    font-size: 38px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text);
    background: transparent;
    border: 1px solid rgba(201, 169, 110, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(201, 169, 110, 0.06);
}

.btn-enter:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201, 169, 110, 0.08);
    letter-spacing: 0.42em;
    padding-left: 0.42em;
    box-shadow: 0 0 60px rgba(201, 169, 110, 0.18);
}

.btn-enter:active {
    transform: scale(0.97);
}

/* Пульсация текста */
.btn-enter > span {
    display: inline-block;
    animation: heartbeat 1.4s ease-in-out infinite;
}

.btn-enter:hover > span,
.btn-enter:active > span {
    animation: none;
}

@keyframes heartbeat {
    0%   { transform: scale(1);    }
    14%  { transform: scale(1.14); }
    28%  { transform: scale(1);    }
    42%  { transform: scale(1.14); }
    70%  { transform: scale(1);    }
    100% { transform: scale(1);    }
}

/* =====================================================
   ПРАВАЯ ПОЛОВИНА (белая овчарка)
   ===================================================== */
.right-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    overflow: hidden;
}

.sketch {
    height: 100vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 0 50px rgba(232, 230, 225, 0.15));
}

/* =====================================================
   ЗАТЕМНЕНИЕ
   ===================================================== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 7, 0.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 5;
}

body.modal-open .overlay {
    opacity: 1;
    pointer-events: auto;
}

/* =====================================================
   МОДАЛЬНОЕ ОКНО
   ===================================================== */
.login-bubble {
    position: fixed;
    left: 50%;
    top: 50%;

    width: 320px;
    padding: 32px 28px 28px;

    background: rgba(20, 20, 26, 0.92);
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(201, 169, 110, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(201, 169, 110, 0.1);

    color: var(--text);
    z-index: 10;

    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.1);
    transform-origin: center center;

    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

body.modal-open .login-bubble {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.bubble-title {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin-bottom: 24px;
}

.bubble-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.bubble-close:hover {
    opacity: 1;
    color: var(--accent);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(232, 230, 225, 0.6);
}

.field-input {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.field-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.field-submit {
    margin-top: 6px;
    padding: 14px;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid rgba(201, 169, 110, 0.5);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.field-submit:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(201, 169, 110, 0.08);
}

.field-submit:active {
    transform: scale(0.98);
}

/* =====================================================
   МОБИЛЬНЫЕ
   ===================================================== */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .topbar {
        padding: 14px 20px;
    }

    .brand-logo {
        height: 44px;
    }

    main {
        flex-direction: column;
        min-height: 100vh;
    }

    .left-side,
    .right-side {
        flex: none;
        padding: 40px 20px;
    }

    .right-side {
        order: -1;
    }

    .sketch {
        height: auto;
        max-height: 55vh;
        width: min(340px, 80vw);
    }

    .btn-enter {
        width: 180px;
        height: 180px;
        font-size: 22px;
    }

    .login-bubble {
        width: min(320px, 88vw);
    }
}