/* CVPN Account — Email & Telegram integration dialogs v18 */

.account-method-row.is-interactive {
    cursor: pointer;
    transition:
        background .16s ease,
        box-shadow .16s ease;
}

.account-method-row.is-interactive:hover {
    background: rgb(255 255 255 / 3%);
}

.account-method-row.is-interactive:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid rgb(124 177 255 / 45%);
    outline-offset: -3px;
}

.account-method-row.is-interactive .settings-state {
    border-color: #3c526f;
    background: #172235;
    color: #b3cef5;
}

.integration-dialog {
    width: min(590px, calc(100vw - 28px));
    max-width: 590px;
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: #eaf0f8;
}

.integration-dialog::backdrop {
    background: rgb(3 6 10 / 76%);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.integration-sheet {
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 25px;
    background:
        radial-gradient(circle at 92% -8%, rgb(92 137 207 / 10%), transparent 34%),
        #0b121b;
    box-shadow:
        0 34px 100px rgb(0 0 0 / 52%),
        inset 0 1px 0 rgb(255 255 255 / 4%);
}

.integration-scroll {
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #2b394e transparent;
}

.integration-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgb(255 255 255 / 6%);
}

.integration-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.integration-brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid #31415a;
    border-radius: 13px;
    background: #151f2d;
    color: #a9c6f2;
}

.integration-brand-mark svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.integration-brand-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.integration-brand-copy strong {
    overflow: hidden;
    color: #edf2fa;
    font-size: 15px;
    font-weight: 720;
    line-height: 1.25;
    letter-spacing: .045em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-brand-copy small {
    overflow: hidden;
    color: #7f90a7;
    font-size: 10.5px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-close {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #8191a9;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition:
        background .16s ease,
        color .16s ease,
        border-color .16s ease;
}

.integration-close:hover {
    border-color: #2e3b4f;
    background: #151e2a;
    color: #e0e8f5;
}

.integration-close:focus-visible,
.integration-dialog button:focus-visible,
.integration-dialog a:focus-visible,
.integration-dialog input:focus-visible {
    outline: 3px solid rgb(125 181 255 / 43%);
    outline-offset: 2px;
}

.integration-content {
    padding: 20px 20px 18px;
}

.integration-intro {
    margin-bottom: 19px;
}

.integration-kicker {
    display: block;
    margin-bottom: 6px;
    color: #8195b3;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 1.45px;
}

.integration-intro h2 {
    margin: 0;
    color: #f0f4fa;
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 720;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.integration-intro p {
    max-width: 48ch;
    margin: 8px 0 0;
    color: #8999af;
    font-size: 12.5px;
    line-height: 1.55;
}

.integration-progress {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid #26354a;
    border-radius: 14px;
    background: #0d1621;
}

.integration-progress-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6f8098;
    font-size: 10px;
    font-weight: 600;
}

.integration-progress-step > span {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border: 1px solid #314057;
    border-radius: 50%;
    background: #0d151f;
    color: #7f90a8;
    font-size: 9px;
    font-weight: 760;
}

.integration-progress-step.is-active {
    color: #dce7f7;
}

.integration-progress-step.is-active > span {
    border-color: #5073a4;
    background: #172740;
    color: #c6dcff;
}

.integration-progress-step.is-complete {
    color: #92d7ad;
}

.integration-progress-step.is-complete > span {
    border-color: #2e654b;
    background: #143327;
    color: #a5e6bd;
}

.integration-progress-line {
    height: 1px;
    min-width: 22px;
    background: #28364a;
}

.integration-progress-line.is-complete {
    background: #356d51;
}

.integration-step[hidden] {
    display: none !important;
}

.integration-form {
    display: grid;
    gap: 14px;
}

.integration-step {
    padding: 16px;
    border: 1px solid #25344a;
    border-radius: 17px;
    background: #0d1621;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 2.5%);
}

.integration-field {
    display: grid;
    gap: 7px;
}

.integration-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.integration-field label,
.integration-field-label {
    margin: 0;
    color: #aebbd0;
    font-size: 11px;
    font-weight: 650;
}

.integration-field-note {
    color: #687b95;
    font-size: 9.5px;
}

.integration-input-shell {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    overflow: hidden;
    border: 1px solid #33435a;
    border-radius: 14px;
    background: #09111a;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.integration-input-shell:focus-within {
    border-color: #6f94ca;
    background: #0a131e;
    box-shadow: 0 0 0 3px rgb(92 146 220 / 12%);
}

.integration-input-shell.is-code {
    grid-template-columns: 1fr;
}

.integration-input-icon {
    display: grid;
    width: 38px;
    height: 100%;
    place-items: center;
    border-right: 1px solid rgb(255 255 255 / 5%);
    color: #7890b2;
}

.integration-input-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.integration-input-shell input {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 50px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: #edf2f9;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.integration-input-shell.is-code input {
    padding: 0 14px;
    color: #eef4fc;
    font-family: var(--cvpn-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: .26em;
    text-align: center;
}

.integration-input-shell input::placeholder {
    color: #52647d;
}

.integration-input-shell input:-webkit-autofill,
.integration-input-shell input:-webkit-autofill:hover,
.integration-input-shell input:-webkit-autofill:focus,
.integration-input-shell input:-webkit-autofill:active {
    -webkit-text-fill-color: #edf2f9 !important;
    caret-color: #edf2f9;
    -webkit-box-shadow: 0 0 0 1000px #09111a inset !important;
    box-shadow: 0 0 0 1000px #09111a inset !important;
    transition: background-color 9999s ease-out 0s;
}

.integration-input-shell:focus-within input:-webkit-autofill,
.integration-input-shell:focus-within input:-webkit-autofill:hover,
.integration-input-shell:focus-within input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0a131e inset !important;
    box-shadow: 0 0 0 1000px #0a131e inset !important;
}

.integration-password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.integration-text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #9bb9e7;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.integration-text-button:hover {
    color: #d4e4fb;
}

.integration-destination {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #2c4059;
    border-radius: 15px;
    background:
        linear-gradient(120deg, rgb(94 148 226 / 7%), transparent 46%),
        #0d1622;
}

.integration-destination-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #314b6b;
    border-radius: 12px;
    background: #15243a;
    color: #a9c7f5;
}

.integration-destination-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.integration-destination-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.integration-destination-copy strong {
    overflow: hidden;
    color: #e6edf7;
    font-size: 12.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-destination-copy span {
    color: #7f91aa;
    font-size: 10px;
    line-height: 1.35;
}

.integration-clock {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid #334257;
    border-radius: 999px;
    background: #131d2a;
    color: #94a6bf;
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
}

.integration-alert {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px solid #62424a;
    border-radius: 13px;
    background: #27181d;
    color: #ffc7d0;
    font-size: 10.5px;
    line-height: 1.5;
}

.integration-alert[hidden] {
    display: none;
}

.integration-alert-mark {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: #3a2229;
    color: #ffb4c0;
    font-size: 11px;
    font-weight: 800;
}

.integration-hint {
    margin: 12px 2px 0;
    color: #72849d;
    font-size: 10px;
    line-height: 1.55;
}

.integration-hint a {
    color: #9dbce9;
    text-decoration: none;
}

.integration-hint a:hover {
    color: #d6e5fb;
}

.integration-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 18px;
}

.integration-actions.is-single {
    grid-template-columns: 1fr;
}

.integration-actions .button {
    min-height: 44px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 13px;
    font-size: 11px;
    text-align: center;
}

.integration-actions .button.primary {
    min-width: 160px;
}

.integration-actions .button[disabled],
.integration-dialog[aria-busy="true"] .integration-actions {
    opacity: .62;
}

.integration-form + .integration-hint {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgb(255 255 255 / 6%);
}

.telegram-stage {
    display: grid;
    gap: 13px;
}

.telegram-hero {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 14px;
    border: 1px solid #2d4058;
    border-radius: 17px;
    background:
        radial-gradient(circle at 0 0, rgb(69 151 230 / 15%), transparent 56%),
        #101a27;
}

.telegram-hero-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid #335678;
    border-radius: 14px;
    background: #162b40;
    color: #9ed2ff;
}

.telegram-hero-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.telegram-hero-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.telegram-hero-copy strong {
    color: #edf3fb;
    font-size: 14px;
    font-weight: 680;
}

.telegram-hero-copy span {
    color: #8799b1;
    font-size: 10.5px;
    line-height: 1.45;
}

.telegram-waiting {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid #33465f;
    border-radius: 13px;
    background: #101a26;
    color: #a1b2c9;
    font-size: 10.5px;
    line-height: 1.45;
}

.telegram-waiting-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7fb2f2;
    box-shadow: 0 0 0 0 rgb(127 178 242 / 35%);
    animation: integration-pulse 1.7s infinite;
}

.telegram-identity {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 12px;
    border: 1px solid #2e5c48;
    border-radius: 14px;
    background: #10251d;
}

.telegram-identity-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #326b50;
    border-radius: 12px;
    background: #173429;
    color: #a9e8c1;
    font-size: 16px;
    font-weight: 800;
}

.telegram-identity-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.telegram-identity-copy strong {
    overflow: hidden;
    color: #dff4e7;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telegram-identity-copy span {
    color: #8eb5a0;
    font-size: 10px;
}

.integration-success {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 24px 16px 12px;
    text-align: center;
}

.integration-success-mark {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid #326c50;
    border-radius: 17px;
    background: #15362a;
    color: #a7e6bf;
    font-size: 22px;
    font-weight: 850;
}

.integration-success strong {
    color: #edf5f0;
    font-size: 18px;
    font-weight: 700;
}

.integration-success p {
    max-width: 40ch;
    margin: 0;
    color: #849d8e;
    font-size: 11px;
    line-height: 1.5;
}

@keyframes integration-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(127 178 242 / 0%); }
    45% { box-shadow: 0 0 0 6px rgb(127 178 242 / 13%); }
}

@media (max-width: 600px) {
    .integration-dialog {
        width: 100%;
        max-width: none;
        max-height: 94dvh;
        margin: auto 0 0;
    }

   .integration-sheet {
        border-radius: 25px 25px 0 0;
        border-bottom: 0;
    }

    .integration-scroll {
        max-height: 94dvh;
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .integration-top {
        padding: 14px 15px 13px;
    }

    .integration-content {
        padding: 16px 14px 16px;
    }

    .integration-step {
        padding: 14px;
        border-radius: 16px;
    }

    .integration-intro h2 {
        font-size: 23px;
    }

    .integration-password-grid {
        grid-template-columns: 1fr;
    }

    .integration-actions {
        grid-template-columns: 1fr;
    }

    .integration-actions .button.primary {
        min-width: 0;
        grid-row: 1;
    }

    .integration-destination {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .integration-clock {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 390px) {
    .integration-brand-copy small {
        max-width: 190px;
    }

    .integration-progress-step {
        gap: 5px;
    }

    .integration-progress-step > strong {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .account-method-row.is-interactive,
    .integration-close,
    .integration-input-shell {
        transition: none;
    }

    .telegram-waiting-dot {
        animation: none;
    }
}

/* Password change — CVPN Security v20 */
.password-change-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin: 2px 0 0;
    color: #708199;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.password-change-divider::before,
.password-change-divider::after {
    content: "";
    height: 1px;
    background: #223044;
}

.password-change-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}

.password-change-checks span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid #29384c;
    border-radius: 999px;
    background: #0a131d;
    color: #73849b;
    font-size: 9.5px;
    line-height: 1.25;
    transition:
        border-color .16s ease,
        background .16s ease,
        color .16s ease;
}

.password-change-checks span::before {
    content: "•";
    margin-right: 6px;
    color: #5f718a;
    font-size: 12px;
    line-height: 1;
}

.password-change-checks span.is-valid {
    border-color: #2e654b;
    background: #10271e;
    color: #9bd8b3;
}

.password-change-checks span.is-valid::before {
    content: "✓";
    color: #82d6a4;
}

.password-change-checks span.is-invalid {
    border-color: #66404a;
    background: #241419;
    color: #d79ca9;
}

.password-change-checks span.is-invalid::before {
    content: "×";
    color: #dc899b;
}

@media (max-width: 600px) {
    .password-change-checks {
        display: grid;
        grid-template-columns: 1fr;
    }

    .password-change-checks span {
        border-radius: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .password-change-checks span {
        transition: none;
    }
}
