.gc-tool-modal[hidden] {
    display: none !important;
}

.gc-tool-modal {
    position: fixed;
    z-index: 2200;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
    background: rgba(3, 8, 20, 0.86);
}

.gc-tool-dialog {
    width: min(950px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid #2b3954;
    border-radius: 8px;
    background: #111a2c;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
    color: #e9eef8;
}

.gc-tool-header {
    display: grid;
    min-height: 118px;
    padding: 22px 24px 20px 40px;
    grid-template-columns: 42px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #2a3851;
    background: #18253e;
}

.gc-tool-brand-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #4d8dff;
    font-size: 28px;
}

.gc-tool-heading h2 {
    margin: 0;
    color: #f4f7fc;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
}

.gc-tool-heading p {
    margin: 7px 0 0;
    color: #96a4bb;
    font-size: 13px;
    line-height: 1.4;
}

.gc-tool-header .gc-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid #34435d;
    border-radius: 6px;
    background: #111b2e;
    color: #9ba9bd;
    cursor: pointer;
}

.gc-tool-header .gc-icon-button:hover {
    border-color: #4d8dff;
    color: #ffffff;
}

.gc-totp-layout {
    display: grid;
    grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
}

.gc-totp-input-panel {
    display: flex;
    min-width: 0;
    min-height: 374px;
    padding: 38px 40px 32px;
    flex-direction: column;
    border-right: 1px solid #24324a;
    background: #152037;
}

.gc-totp-form {
    display: grid;
    gap: 13px;
}

.gc-totp-form > label {
    color: #a7b3c6;
    font-size: 13px;
    font-weight: 600;
}

.gc-totp-form > input {
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 0 16px;
    border: 1px solid #35435c;
    border-radius: 7px;
    outline: 0;
    background: #111a2d;
    color: #f4f7fc;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 14px;
}

.gc-totp-form > input::placeholder {
    color: #77849a;
}

.gc-totp-form > input:focus {
    border-color: #4f8dff;
    box-shadow: 0 0 0 3px rgba(79, 141, 255, 0.16);
}

.gc-totp-form-actions {
    display: grid;
    margin-top: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gc-totp-generate,
.gc-totp-clear {
    display: inline-flex;
    min-width: 0;
    min-height: 46px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
}

.gc-totp-generate {
    background: linear-gradient(90deg, #3f8cff, #8658f5);
    box-shadow: 0 9px 24px rgba(79, 110, 255, 0.28);
    color: #ffffff;
}

.gc-totp-generate:hover {
    filter: brightness(1.07);
}

.gc-totp-clear {
    background: #2c374c;
    color: #aab5c7;
}

.gc-totp-clear:hover {
    background: #364258;
    color: #ffffff;
}

.gc-totp-examples {
    margin-top: 28px;
}

.gc-totp-examples > p {
    margin: 0 0 9px;
    color: #8f9db2;
    font-size: 12px;
}

.gc-totp-examples > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gc-totp-examples button {
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid #39465e;
    border-radius: 15px;
    background: #111a2d;
    color: #9eacc0;
    cursor: pointer;
    font-size: 12px;
}

.gc-totp-examples button:hover,
.gc-totp-examples button:focus-visible {
    border-color: #4f8dff;
    color: #ffffff;
}

.gc-totp-privacy {
    display: flex;
    margin: auto 0 0;
    padding-top: 28px;
    align-items: center;
    gap: 6px;
    color: #718096;
    font-size: 11px;
    line-height: 1.5;
}

.gc-totp-result {
    display: flex;
    min-width: 0;
    min-height: 374px;
    padding: 70px 40px 36px;
    flex-direction: column;
    background: #0e1728;
}

.gc-totp-code-card {
    display: grid;
    width: 100%;
    min-height: 150px;
    padding: 24px;
    place-content: center;
    gap: 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #09111f;
    color: #ffffff;
    text-align: center;
}

.gc-totp-code-card:disabled {
    cursor: default;
    opacity: 1;
}

.gc-totp-code-card:not(:disabled) {
    cursor: pointer;
}

.gc-totp-code-card:not(:disabled):hover,
.gc-totp-code-card:not(:disabled):focus-visible {
    border-color: #405d93;
}

.gc-totp-code-card output {
    color: #4b8eff;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 39px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    text-shadow: 0 0 18px rgba(75, 142, 255, 0.32);
    white-space: nowrap;
}

.gc-totp-code-card > span {
    color: #8492a8;
    font-size: 12px;
}

.gc-totp-state-row {
    display: flex;
    margin-top: 18px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #9aa8bb;
    font-size: 12px;
}

.gc-totp-status[data-state="running"] {
    color: #6ed6b1;
}

.gc-totp-status[data-state="error"] {
    color: #ff8198;
}

.gc-totp-remaining strong {
    font-weight: 600;
}

.gc-totp-result progress {
    width: 100%;
    height: 6px;
    margin-top: 14px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: #253147;
    color: #5c7cff;
    accent-color: #5c7cff;
}

.gc-totp-result progress::-webkit-progress-bar {
    border-radius: 3px;
    background: #253147;
}

.gc-totp-result progress::-webkit-progress-value {
    border-radius: 3px;
    background: linear-gradient(90deg, #3f8cff, #8658f5);
}

.gc-totp-result progress::-moz-progress-bar {
    border-radius: 3px;
    background: #5c7cff;
}

@media (max-width: 767.98px) {
    .gc-tool-modal {
        padding: 8px;
        place-items: center;
    }

    .gc-tool-dialog {
        max-height: calc(100vh - 16px);
    }

    .gc-tool-header {
        min-height: 64px;
        padding: 10px 12px 10px 18px;
        grid-template-columns: 30px minmax(0, 1fr) 36px;
        gap: 8px;
    }

    .gc-tool-brand-icon {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .gc-tool-heading h2 {
        font-size: 18px;
    }

    .gc-tool-heading p {
        display: none;
    }

    .gc-tool-header .gc-icon-button {
        width: 34px;
        height: 34px;
    }

    .gc-totp-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .gc-totp-input-panel {
        min-height: 0;
        padding: 20px 20px 16px;
        border-right: 0;
        border-bottom: 1px solid #24324a;
    }

    .gc-totp-form {
        gap: 8px;
    }

    .gc-totp-form > input {
        height: 48px;
    }

    .gc-totp-form-actions {
        margin-top: 7px;
        gap: 10px;
    }

    .gc-totp-generate,
    .gc-totp-clear {
        min-height: 42px;
        font-size: 13px;
    }

    .gc-totp-examples {
        margin-top: 16px;
    }

    .gc-totp-examples > div {
        gap: 6px;
    }

    .gc-totp-examples button {
        min-height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }

    .gc-totp-privacy {
        margin-top: 14px;
        padding-top: 0;
        justify-content: center;
        font-size: 10px;
    }

    .gc-totp-result {
        min-height: 0;
        padding: 20px;
    }

    .gc-totp-code-card {
        min-height: 104px;
        padding: 16px;
        gap: 12px;
    }

    .gc-totp-code-card output {
        font-size: 31px;
    }

    .gc-totp-state-row {
        margin-top: 13px;
    }

    .gc-totp-result progress {
        margin-top: 10px;
    }
}

@media (max-width: 359.98px) {
    .gc-totp-input-panel,
    .gc-totp-result {
        padding-right: 16px;
        padding-left: 16px;
    }

    .gc-totp-code-card output {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gc-totp-generate {
        box-shadow: none;
    }
}
